author | Claus Gittinger <cg@exept.de> |
Tue, 16 Nov 1999 21:51:20 +0100 | |
changeset 993 | 902eec8d132b |
parent 970 | dcefff31caa2 |
child 1146 | e3e399a85be0 |
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 |
" |
|
12 |
||
13 |
Object subclass:#UndefinedVariable |
|
261 | 14 |
instanceVariableNames:'name' |
15 |
classVariableNames:'' |
|
16 |
poolDictionaries:'' |
|
17 |
category:'System-Compiler-Support' |
|
0 | 18 |
! |
19 |
||
20 | 20 |
!UndefinedVariable class methodsFor:'documentation'! |
21 |
||
22 |
copyright |
|
23 |
" |
|
24 |
COPYRIGHT (c) 1993 by Claus Gittinger |
|
84 | 25 |
All Rights Reserved |
0 | 26 |
|
20 | 27 |
This software is furnished under a license and may be used |
28 |
only in accordance with the terms of that license and with the |
|
29 |
inclusion of the above copyright notice. This software may not |
|
30 |
be provided or otherwise made available to, or used by, any |
|
31 |
other person. No title to or ownership of the software is |
|
32 |
hereby transferred. |
|
33 |
" |
|
34 |
! |
|
0 | 35 |
|
20 | 36 |
documentation |
37 |
" |
|
38 |
node for parse-trees, representing undefined variables |
|
261 | 39 |
This is a helper class for the compiler. |
20 | 40 |
|
41 |
This class exists solely for the error message when accessing undefined |
|
42 |
variables - instead of returning nil, the compiler returns an instance |
|
43 |
of this class, which will not understand ANY message. |
|
44 |
The error message will then be 'UndefinedVariable ...' |
|
45 |
instead of 'UndefineObject ...', which is somewhat more informative. |
|
263 | 46 |
|
47 |
[author:] |
|
48 |
Claus Gittinger |
|
20 | 49 |
" |
50 |
! ! |
|
0 | 51 |
|
52 |
!UndefinedVariable class methodsFor:'instance creation'! |
|
53 |
||
54 |
name:aString |
|
55 |
^ (self basicNew) setName:aString |
|
56 |
! ! |
|
57 |
||
58 |
!UndefinedVariable methodsFor:'catching messages'! |
|
59 |
||
60 |
class |
|
61 |
^ self |
|
62 |
! |
|
63 |
||
64 |
methods |
|
65 |
self methodError |
|
66 |
! |
|
67 |
||
68 |
methodsFor:arg |
|
734
c75125f782a2
return the value from methodsFor: (even on error)
Claus Gittinger <cg@exept.de>
parents:
643
diff
changeset
|
69 |
^ self methodError |
c75125f782a2
return the value from methodsFor: (even on error)
Claus Gittinger <cg@exept.de>
parents:
643
diff
changeset
|
70 |
|
c75125f782a2
return the value from methodsFor: (even on error)
Claus Gittinger <cg@exept.de>
parents:
643
diff
changeset
|
71 |
"Modified: / 18.6.1998 / 14:43:33 / cg" |
0 | 72 |
! |
73 |
||
621
37592efa4daa
allow squeak code to be filedIn (methodsFor:stamp:)
Claus Gittinger <cg@exept.de>
parents:
276
diff
changeset
|
74 |
methodsFor:aCategory stamp:time |
37592efa4daa
allow squeak code to be filedIn (methodsFor:stamp:)
Claus Gittinger <cg@exept.de>
parents:
276
diff
changeset
|
75 |
"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
|
76 |
|
37592efa4daa
allow squeak code to be filedIn (methodsFor:stamp:)
Claus Gittinger <cg@exept.de>
parents:
276
diff
changeset
|
77 |
^ self methodsFor:aCategory |
37592efa4daa
allow squeak code to be filedIn (methodsFor:stamp:)
Claus Gittinger <cg@exept.de>
parents:
276
diff
changeset
|
78 |
|
37592efa4daa
allow squeak code to be filedIn (methodsFor:stamp:)
Claus Gittinger <cg@exept.de>
parents:
276
diff
changeset
|
79 |
"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
|
80 |
! |
37592efa4daa
allow squeak code to be filedIn (methodsFor:stamp:)
Claus Gittinger <cg@exept.de>
parents:
276
diff
changeset
|
81 |
|
0 | 82 |
subclass:t instanceVariableNames:f classVariableNames:d poolDictionaries:s |
83 |
self subclassingError |
|
84 |
! |
|
85 |
||
86 |
subclass:t instanceVariableNames:f classVariableNames:d poolDictionaries:s category:cat |
|
87 |
self subclassingError |
|
88 |
! |
|
89 |
||
90 |
variableByteSubclass:t instanceVariableNames:f |
|
84 | 91 |
classVariableNames:d poolDictionaries:s category:cat |
0 | 92 |
self subclassingError |
93 |
! |
|
94 |
||
95 |
variableSubclass:t instanceVariableNames:f |
|
84 | 96 |
classVariableNames:d poolDictionaries:s category:cat |
0 | 97 |
self subclassingError |
98 |
! |
|
99 |
||
100 |
variableWordSubclass:t instanceVariableNames:f |
|
84 | 101 |
classVariableNames:d poolDictionaries:s category:cat |
0 | 102 |
self subclassingError |
103 |
! ! |
|
104 |
||
140 | 105 |
!UndefinedVariable methodsFor:'error reporting'! |
106 |
||
107 |
methodError |
|
970 | 108 |
Parser::UndefinedSuperclassError |
109 |
raiseRequestWith:self |
|
110 |
errorString:('trying to define methods for undefined class: ', name) |
|
140 | 111 |
! |
112 |
||
113 |
subclassingError |
|
970 | 114 |
Parser::UndefinedSuperclassError |
115 |
raiseRequestWith:self |
|
116 |
errorString:('trying to create subclass of undefined class: ', name) |
|
140 | 117 |
! ! |
118 |
||
119 |
!UndefinedVariable methodsFor:'file skipping'! |
|
0 | 120 |
|
140 | 121 |
fileInFrom:aStream notifying:someOne passChunk:passChunk |
122 |
"this is sent, if you continue after a warning about |
|
123 |
methods for undefined class. |
|
124 |
It simply skips chunks and sends a warning to the Transcript." |
|
125 |
||
126 |
|aString done| |
|
127 |
||
128 |
done := false. |
|
129 |
[done] whileFalse:[ |
|
276 | 130 |
done := aStream atEnd. |
131 |
done ifFalse:[ |
|
132 |
aString := aStream nextChunk. |
|
814 | 133 |
done := (aString size == 0). |
276 | 134 |
done ifFalse:[ |
135 |
Transcript showCR:'*** skipping method for undefined class: ' , name |
|
136 |
] |
|
137 |
] |
|
140 | 138 |
]. |
276 | 139 |
|
140 |
"Modified: 18.5.1996 / 15:45:03 / cg" |
|
0 | 141 |
! ! |
142 |
||
143 |
!UndefinedVariable methodsFor:'printing & storing'! |
|
144 |
||
643
66ff59b7e2d3
Define #printOn: instead of #printString
Stefan Vogel <sv@exept.de>
parents:
621
diff
changeset
|
145 |
printOn:aStream |
66ff59b7e2d3
Define #printOn: instead of #printString
Stefan Vogel <sv@exept.de>
parents:
621
diff
changeset
|
146 |
"print myself on aStream" |
0 | 147 |
|
643
66ff59b7e2d3
Define #printOn: instead of #printString
Stefan Vogel <sv@exept.de>
parents:
621
diff
changeset
|
148 |
aStream nextPutAll:'UndefinedVariable('. |
66ff59b7e2d3
Define #printOn: instead of #printString
Stefan Vogel <sv@exept.de>
parents:
621
diff
changeset
|
149 |
name printOn:aStream. |
66ff59b7e2d3
Define #printOn: instead of #printString
Stefan Vogel <sv@exept.de>
parents:
621
diff
changeset
|
150 |
aStream nextPut:$). |
66ff59b7e2d3
Define #printOn: instead of #printString
Stefan Vogel <sv@exept.de>
parents:
621
diff
changeset
|
151 |
|
66ff59b7e2d3
Define #printOn: instead of #printString
Stefan Vogel <sv@exept.de>
parents:
621
diff
changeset
|
152 |
" |
66ff59b7e2d3
Define #printOn: instead of #printString
Stefan Vogel <sv@exept.de>
parents:
621
diff
changeset
|
153 |
self new printOn:Transcript |
66ff59b7e2d3
Define #printOn: instead of #printString
Stefan Vogel <sv@exept.de>
parents:
621
diff
changeset
|
154 |
" |
66ff59b7e2d3
Define #printOn: instead of #printString
Stefan Vogel <sv@exept.de>
parents:
621
diff
changeset
|
155 |
|
66ff59b7e2d3
Define #printOn: instead of #printString
Stefan Vogel <sv@exept.de>
parents:
621
diff
changeset
|
156 |
"Created: / 20.1.1998 / 14:10:46 / stefan" |
0 | 157 |
! ! |
140 | 158 |
|
159 |
!UndefinedVariable methodsFor:'private accessing'! |
|
160 |
||
161 |
setName:aString |
|
162 |
name := aString |
|
163 |
! ! |
|
164 |
||
148 | 165 |
!UndefinedVariable class methodsFor:'documentation'! |
166 |
||
167 |
version |
|
970 | 168 |
^ '$Header: /cvs/stx/stx/libcomp/UndefinedVariable.st,v 1.19 1999-09-20 07:56:10 cg Exp $' |
148 | 169 |
! ! |