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
|
|
14 |
instanceVariableNames:'name'
|
|
15 |
classVariableNames:''
|
|
16 |
poolDictionaries:''
|
|
17 |
category:'System-Compiler-Support'
|
|
18 |
!
|
|
19 |
|
|
20 |
UndefinedVariable comment:'
|
20
|
21 |
COPYRIGHT (c) 1993 by Claus Gittinger
|
84
|
22 |
All Rights Reserved
|
33
|
23 |
|
102
|
24 |
$Header: /cvs/stx/stx/libcomp/Attic/UndefVar.st,v 1.6 1995-08-10 18:12:49 claus Exp $
|
20
|
25 |
'!
|
0
|
26 |
|
20
|
27 |
!UndefinedVariable class methodsFor:'documentation'!
|
|
28 |
|
|
29 |
copyright
|
|
30 |
"
|
|
31 |
COPYRIGHT (c) 1993 by Claus Gittinger
|
84
|
32 |
All Rights Reserved
|
0
|
33 |
|
20
|
34 |
This software is furnished under a license and may be used
|
|
35 |
only in accordance with the terms of that license and with the
|
|
36 |
inclusion of the above copyright notice. This software may not
|
|
37 |
be provided or otherwise made available to, or used by, any
|
|
38 |
other person. No title to or ownership of the software is
|
|
39 |
hereby transferred.
|
|
40 |
"
|
|
41 |
!
|
0
|
42 |
|
20
|
43 |
version
|
|
44 |
"
|
102
|
45 |
$Header: /cvs/stx/stx/libcomp/Attic/UndefVar.st,v 1.6 1995-08-10 18:12:49 claus Exp $
|
|
46 |
$Revision: 1.6 $
|
20
|
47 |
"
|
|
48 |
!
|
|
49 |
|
|
50 |
documentation
|
|
51 |
"
|
|
52 |
node for parse-trees, representing undefined variables
|
|
53 |
|
|
54 |
This class exists solely for the error message when accessing undefined
|
|
55 |
variables - instead of returning nil, the compiler returns an instance
|
|
56 |
of this class, which will not understand ANY message.
|
|
57 |
The error message will then be 'UndefinedVariable ...'
|
|
58 |
instead of 'UndefineObject ...', which is somewhat more informative.
|
|
59 |
"
|
|
60 |
! !
|
0
|
61 |
|
|
62 |
!UndefinedVariable class methodsFor:'instance creation'!
|
|
63 |
|
|
64 |
name:aString
|
|
65 |
^ (self basicNew) setName:aString
|
|
66 |
! !
|
|
67 |
|
|
68 |
!UndefinedVariable methodsFor:'error reporting'!
|
|
69 |
|
|
70 |
methodError
|
|
71 |
self error:('trying to define methods for undefined class: ', name)
|
|
72 |
!
|
|
73 |
|
|
74 |
subclassingError
|
|
75 |
self error:('trying to create subclass of undefined class: ', name)
|
|
76 |
! !
|
|
77 |
|
84
|
78 |
!UndefinedVariable methodsFor:'file skipping'!
|
|
79 |
|
|
80 |
fileInFrom:aStream notifying:someOne passChunk:passChunk
|
|
81 |
"this is sent, if you continue after a warning about
|
|
82 |
methods for undefined class.
|
|
83 |
It simply skips chunks and sends a warning to the Transcript."
|
|
84 |
|
|
85 |
|aString done|
|
|
86 |
|
|
87 |
done := false.
|
|
88 |
[done] whileFalse:[
|
|
89 |
done := aStream atEnd.
|
|
90 |
done ifFalse:[
|
|
91 |
aString := aStream nextChunk.
|
|
92 |
done := aString isNil or:[aString isEmpty].
|
|
93 |
done ifFalse:[
|
|
94 |
Transcript showCr:'*** skipping method for undefined class: ' , name
|
|
95 |
]
|
|
96 |
]
|
|
97 |
].
|
|
98 |
! !
|
|
99 |
|
0
|
100 |
!UndefinedVariable methodsFor:'catching messages'!
|
|
101 |
|
|
102 |
class
|
|
103 |
^ self
|
|
104 |
!
|
|
105 |
|
|
106 |
methods
|
|
107 |
self methodError
|
|
108 |
!
|
|
109 |
|
|
110 |
methodsFor:arg
|
|
111 |
self methodError
|
|
112 |
!
|
|
113 |
|
|
114 |
subclass:t instanceVariableNames:f classVariableNames:d poolDictionaries:s
|
|
115 |
self subclassingError
|
|
116 |
!
|
|
117 |
|
|
118 |
subclass:t instanceVariableNames:f classVariableNames:d poolDictionaries:s category:cat
|
|
119 |
self subclassingError
|
|
120 |
!
|
|
121 |
|
|
122 |
variableByteSubclass:t instanceVariableNames:f
|
84
|
123 |
classVariableNames:d poolDictionaries:s category:cat
|
0
|
124 |
self subclassingError
|
|
125 |
!
|
|
126 |
|
|
127 |
variableSubclass:t instanceVariableNames:f
|
84
|
128 |
classVariableNames:d poolDictionaries:s category:cat
|
0
|
129 |
self subclassingError
|
|
130 |
!
|
|
131 |
|
|
132 |
variableWordSubclass:t instanceVariableNames:f
|
84
|
133 |
classVariableNames:d poolDictionaries:s category:cat
|
0
|
134 |
self subclassingError
|
|
135 |
! !
|
|
136 |
|
|
137 |
!UndefinedVariable methodsFor:'private accessing'!
|
|
138 |
|
|
139 |
setName:aString
|
|
140 |
name := aString
|
|
141 |
! !
|
|
142 |
|
|
143 |
!UndefinedVariable methodsFor:'printing & storing'!
|
|
144 |
|
|
145 |
printString
|
|
146 |
"return a string for printing myself"
|
|
147 |
|
|
148 |
^ 'UndefinedVariable(' , name , ')'
|
|
149 |
! !
|