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