author | Claus Gittinger <cg@exept.de> |
Thu, 28 Mar 2019 16:27:18 +0100 | |
changeset 4401 | 4e87a9cca486 |
parent 3105 | d68fef02ca9c |
permissions | -rw-r--r-- |
0 | 1 |
" |
2 |
COPYRIGHT (c) 1993 by Claus Gittinger |
|
84 | 3 |
All Rights Reserved |
0 | 4 |
|
5 |
This software is furnished under a license and may be used |
|
6 |
only in accordance with the terms of that license and with the |
|
7 |
inclusion of the above copyright notice. This software may not |
|
8 |
be provided or otherwise made available to, or used by, any |
|
9 |
other person. No title to or ownership of the software is |
|
10 |
hereby transferred. |
|
11 |
" |
|
1146 | 12 |
"{ Package: 'stx:libcomp' }" |
13 |
||
0 | 14 |
Object subclass:#UndefinedVariable |
261 | 15 |
instanceVariableNames:'name' |
16 |
classVariableNames:'' |
|
17 |
poolDictionaries:'' |
|
18 |
category:'System-Compiler-Support' |
|
0 | 19 |
! |
20 |
||
20 | 21 |
!UndefinedVariable class methodsFor:'documentation'! |
22 |
||
23 |
copyright |
|
24 |
" |
|
25 |
COPYRIGHT (c) 1993 by Claus Gittinger |
|
84 | 26 |
All Rights Reserved |
0 | 27 |
|
20 | 28 |
This software is furnished under a license and may be used |
29 |
only in accordance with the terms of that license and with the |
|
30 |
inclusion of the above copyright notice. This software may not |
|
31 |
be provided or otherwise made available to, or used by, any |
|
32 |
other person. No title to or ownership of the software is |
|
33 |
hereby transferred. |
|
34 |
" |
|
35 |
! |
|
0 | 36 |
|
20 | 37 |
documentation |
38 |
" |
|
39 |
node for parse-trees, representing undefined variables |
|
261 | 40 |
This is a helper class for the compiler. |
20 | 41 |
|
42 |
This class exists solely for the error message when accessing undefined |
|
43 |
variables - instead of returning nil, the compiler returns an instance |
|
44 |
of this class, which will not understand ANY message. |
|
45 |
The error message will then be 'UndefinedVariable ...' |
|
46 |
instead of 'UndefineObject ...', which is somewhat more informative. |
|
263 | 47 |
|
48 |
[author:] |
|
49 |
Claus Gittinger |
|
20 | 50 |
" |
51 |
! ! |
|
0 | 52 |
|
53 |
!UndefinedVariable class methodsFor:'instance creation'! |
|
54 |
||
55 |
name:aString |
|
56 |
^ (self basicNew) setName:aString |
|
57 |
! ! |
|
58 |
||
1426 | 59 |
!UndefinedVariable methodsFor:'accessing'! |
60 |
||
61 |
name |
|
62 |
"return the value of the instance variable 'name' (automatically generated)" |
|
63 |
||
64 |
^ name |
|
65 |
! ! |
|
66 |
||
0 | 67 |
!UndefinedVariable methodsFor:'catching messages'! |
68 |
||
69 |
class |
|
70 |
^ self |
|
71 |
! |
|
72 |
||
73 |
methods |
|
74 |
self methodError |
|
75 |
! |
|
76 |
||
1329 | 77 |
methodsFor |
78 |
^ self methodError |
|
79 |
||
80 |
"Modified: / 18.6.1998 / 14:43:33 / cg" |
|
81 |
! |
|
82 |
||
0 | 83 |
methodsFor:arg |
734
c75125f782a2
return the value from methodsFor: (even on error)
Claus Gittinger <cg@exept.de>
parents:
643
diff
changeset
|
84 |
^ self methodError |
c75125f782a2
return the value from methodsFor: (even on error)
Claus Gittinger <cg@exept.de>
parents:
643
diff
changeset
|
85 |
|
c75125f782a2
return the value from methodsFor: (even on error)
Claus Gittinger <cg@exept.de>
parents:
643
diff
changeset
|
86 |
"Modified: / 18.6.1998 / 14:43:33 / cg" |
0 | 87 |
! |
88 |
||
621
37592efa4daa
allow squeak code to be filedIn (methodsFor:stamp:)
Claus Gittinger <cg@exept.de>
parents:
276
diff
changeset
|
89 |
methodsFor:aCategory stamp:time |
37592efa4daa
allow squeak code to be filedIn (methodsFor:stamp:)
Claus Gittinger <cg@exept.de>
parents:
276
diff
changeset
|
90 |
"This was added to allow squeak code to be filedIn." |
37592efa4daa
allow squeak code to be filedIn (methodsFor:stamp:)
Claus Gittinger <cg@exept.de>
parents:
276
diff
changeset
|
91 |
|
37592efa4daa
allow squeak code to be filedIn (methodsFor:stamp:)
Claus Gittinger <cg@exept.de>
parents:
276
diff
changeset
|
92 |
^ self methodsFor:aCategory |
37592efa4daa
allow squeak code to be filedIn (methodsFor:stamp:)
Claus Gittinger <cg@exept.de>
parents:
276
diff
changeset
|
93 |
|
37592efa4daa
allow squeak code to be filedIn (methodsFor:stamp:)
Claus Gittinger <cg@exept.de>
parents:
276
diff
changeset
|
94 |
"Created: 15.10.1997 / 18:52:04 / cg" |
37592efa4daa
allow squeak code to be filedIn (methodsFor:stamp:)
Claus Gittinger <cg@exept.de>
parents:
276
diff
changeset
|
95 |
! |
37592efa4daa
allow squeak code to be filedIn (methodsFor:stamp:)
Claus Gittinger <cg@exept.de>
parents:
276
diff
changeset
|
96 |
|
1977
29f613954262
catchers for #protectedMethodsFor: and #privateMethodsFor:
Stefan Vogel <sv@exept.de>
parents:
1426
diff
changeset
|
97 |
privateMethodsFor:arg |
29f613954262
catchers for #protectedMethodsFor: and #privateMethodsFor:
Stefan Vogel <sv@exept.de>
parents:
1426
diff
changeset
|
98 |
^ self methodError |
29f613954262
catchers for #protectedMethodsFor: and #privateMethodsFor:
Stefan Vogel <sv@exept.de>
parents:
1426
diff
changeset
|
99 |
! |
29f613954262
catchers for #protectedMethodsFor: and #privateMethodsFor:
Stefan Vogel <sv@exept.de>
parents:
1426
diff
changeset
|
100 |
|
29f613954262
catchers for #protectedMethodsFor: and #privateMethodsFor:
Stefan Vogel <sv@exept.de>
parents:
1426
diff
changeset
|
101 |
protectedMethodsFor:arg |
29f613954262
catchers for #protectedMethodsFor: and #privateMethodsFor:
Stefan Vogel <sv@exept.de>
parents:
1426
diff
changeset
|
102 |
^ self methodError |
29f613954262
catchers for #protectedMethodsFor: and #privateMethodsFor:
Stefan Vogel <sv@exept.de>
parents:
1426
diff
changeset
|
103 |
! |
29f613954262
catchers for #protectedMethodsFor: and #privateMethodsFor:
Stefan Vogel <sv@exept.de>
parents:
1426
diff
changeset
|
104 |
|
29f613954262
catchers for #protectedMethodsFor: and #privateMethodsFor:
Stefan Vogel <sv@exept.de>
parents:
1426
diff
changeset
|
105 |
publicMethodsFor:arg |
29f613954262
catchers for #protectedMethodsFor: and #privateMethodsFor:
Stefan Vogel <sv@exept.de>
parents:
1426
diff
changeset
|
106 |
^ self methodError |
29f613954262
catchers for #protectedMethodsFor: and #privateMethodsFor:
Stefan Vogel <sv@exept.de>
parents:
1426
diff
changeset
|
107 |
! |
29f613954262
catchers for #protectedMethodsFor: and #privateMethodsFor:
Stefan Vogel <sv@exept.de>
parents:
1426
diff
changeset
|
108 |
|
0 | 109 |
subclass:t instanceVariableNames:f classVariableNames:d poolDictionaries:s |
110 |
self subclassingError |
|
111 |
! |
|
112 |
||
113 |
subclass:t instanceVariableNames:f classVariableNames:d poolDictionaries:s category:cat |
|
114 |
self subclassingError |
|
115 |
! |
|
116 |
||
1329 | 117 |
subclass:t instanceVariableNames:f classVariableNames:d poolDictionaries:s classInstanceVariableNames:ci |
118 |
self subclassingError |
|
119 |
! |
|
120 |
||
0 | 121 |
variableByteSubclass:t instanceVariableNames:f |
84 | 122 |
classVariableNames:d poolDictionaries:s category:cat |
0 | 123 |
self subclassingError |
124 |
! |
|
125 |
||
126 |
variableSubclass:t instanceVariableNames:f |
|
84 | 127 |
classVariableNames:d poolDictionaries:s category:cat |
0 | 128 |
self subclassingError |
129 |
! |
|
130 |
||
131 |
variableWordSubclass:t instanceVariableNames:f |
|
84 | 132 |
classVariableNames:d poolDictionaries:s category:cat |
0 | 133 |
self subclassingError |
134 |
! ! |
|
135 |
||
140 | 136 |
!UndefinedVariable methodsFor:'error reporting'! |
137 |
||
138 |
methodError |
|
3105 | 139 |
UndefinedSuperclassError |
1284
e1d9a27809d3
Raise nonproceedable errors non-proceedable.
Stefan Vogel <sv@exept.de>
parents:
1146
diff
changeset
|
140 |
raiseWith:self |
970 | 141 |
errorString:('trying to define methods for undefined class: ', name) |
140 | 142 |
! |
143 |
||
144 |
subclassingError |
|
3105 | 145 |
UndefinedSuperclassError |
1284
e1d9a27809d3
Raise nonproceedable errors non-proceedable.
Stefan Vogel <sv@exept.de>
parents:
1146
diff
changeset
|
146 |
raiseWith:self |
970 | 147 |
errorString:('trying to create subclass of undefined class: ', name) |
140 | 148 |
! ! |
149 |
||
150 |
!UndefinedVariable methodsFor:'file skipping'! |
|
0 | 151 |
|
140 | 152 |
fileInFrom:aStream notifying:someOne passChunk:passChunk |
153 |
"this is sent, if you continue after a warning about |
|
154 |
methods for undefined class. |
|
155 |
It simply skips chunks and sends a warning to the Transcript." |
|
156 |
||
157 |
|aString done| |
|
158 |
||
159 |
done := false. |
|
160 |
[done] whileFalse:[ |
|
276 | 161 |
done := aStream atEnd. |
162 |
done ifFalse:[ |
|
163 |
aString := aStream nextChunk. |
|
814 | 164 |
done := (aString size == 0). |
276 | 165 |
done ifFalse:[ |
166 |
Transcript showCR:'*** skipping method for undefined class: ' , name |
|
167 |
] |
|
168 |
] |
|
140 | 169 |
]. |
276 | 170 |
|
171 |
"Modified: 18.5.1996 / 15:45:03 / cg" |
|
0 | 172 |
! ! |
173 |
||
174 |
!UndefinedVariable methodsFor:'printing & storing'! |
|
175 |
||
643
66ff59b7e2d3
Define #printOn: instead of #printString
Stefan Vogel <sv@exept.de>
parents:
621
diff
changeset
|
176 |
printOn:aStream |
66ff59b7e2d3
Define #printOn: instead of #printString
Stefan Vogel <sv@exept.de>
parents:
621
diff
changeset
|
177 |
"print myself on aStream" |
0 | 178 |
|
643
66ff59b7e2d3
Define #printOn: instead of #printString
Stefan Vogel <sv@exept.de>
parents:
621
diff
changeset
|
179 |
aStream nextPutAll:'UndefinedVariable('. |
66ff59b7e2d3
Define #printOn: instead of #printString
Stefan Vogel <sv@exept.de>
parents:
621
diff
changeset
|
180 |
name printOn:aStream. |
66ff59b7e2d3
Define #printOn: instead of #printString
Stefan Vogel <sv@exept.de>
parents:
621
diff
changeset
|
181 |
aStream nextPut:$). |
66ff59b7e2d3
Define #printOn: instead of #printString
Stefan Vogel <sv@exept.de>
parents:
621
diff
changeset
|
182 |
|
66ff59b7e2d3
Define #printOn: instead of #printString
Stefan Vogel <sv@exept.de>
parents:
621
diff
changeset
|
183 |
" |
66ff59b7e2d3
Define #printOn: instead of #printString
Stefan Vogel <sv@exept.de>
parents:
621
diff
changeset
|
184 |
self new printOn:Transcript |
66ff59b7e2d3
Define #printOn: instead of #printString
Stefan Vogel <sv@exept.de>
parents:
621
diff
changeset
|
185 |
" |
66ff59b7e2d3
Define #printOn: instead of #printString
Stefan Vogel <sv@exept.de>
parents:
621
diff
changeset
|
186 |
|
66ff59b7e2d3
Define #printOn: instead of #printString
Stefan Vogel <sv@exept.de>
parents:
621
diff
changeset
|
187 |
"Created: / 20.1.1998 / 14:10:46 / stefan" |
0 | 188 |
! ! |
140 | 189 |
|
1416 | 190 |
!UndefinedVariable methodsFor:'private-accessing'! |
140 | 191 |
|
192 |
setName:aString |
|
193 |
name := aString |
|
194 |
! ! |
|
195 |
||
148 | 196 |
!UndefinedVariable class methodsFor:'documentation'! |
197 |
||
198 |
version |
|
3105 | 199 |
^ '$Header: /cvs/stx/stx/libcomp/UndefinedVariable.st,v 1.26 2013-04-11 08:47:43 stefan Exp $' |
148 | 200 |
! ! |
3105 | 201 |