author | Claus Gittinger <cg@exept.de> |
Tue, 25 Feb 2020 02:40:09 +0100 | |
changeset 4640 | a1bb370605bc |
parent 4270 | 0b40e4987029 |
permissions | -rw-r--r-- |
0 | 1 |
" |
4 | 2 |
COPYRIGHT (c) 1989 by Claus Gittinger |
104 | 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 |
" |
|
1080 | 12 |
"{ Package: 'stx:libcomp' }" |
13 |
||
3936 | 14 |
"{ NameSpace: Smalltalk }" |
15 |
||
0 | 16 |
MessageNode subclass:#UnaryNode |
261 | 17 |
instanceVariableNames:'' |
18 |
classVariableNames:'' |
|
19 |
poolDictionaries:'' |
|
20 |
category:'System-Compiler-Support' |
|
0 | 21 |
! |
22 |
||
20 | 23 |
!UnaryNode class methodsFor:'documentation'! |
24 |
||
25 |
copyright |
|
26 |
" |
|
27 |
COPYRIGHT (c) 1989 by Claus Gittinger |
|
104 | 28 |
All Rights Reserved |
20 | 29 |
|
30 |
This software is furnished under a license and may be used |
|
31 |
only in accordance with the terms of that license and with the |
|
32 |
inclusion of the above copyright notice. This software may not |
|
33 |
be provided or otherwise made available to, or used by, any |
|
34 |
other person. No title to or ownership of the software is |
|
35 |
hereby transferred. |
|
36 |
" |
|
37 |
! |
|
38 |
||
39 |
documentation |
|
40 |
" |
|
41 |
node for parse-trees, representing unary messages |
|
261 | 42 |
This is a helper class for the compiler. |
263 | 43 |
|
44 |
[author:] |
|
45 |
Claus Gittinger |
|
20 | 46 |
" |
47 |
! ! |
|
0 | 48 |
|
49 |
!UnaryNode class methodsFor:'instance creation'! |
|
50 |
||
51 |
receiver:r selector:s |
|
11 | 52 |
"return a new UnaryNode for sending selector s to receiver r. |
53 |
Fold constants." |
|
54 |
||
991
16411f243a75
compile-time-eval Smalltalk #isSmalltalkXXX messages.
Claus Gittinger <cg@exept.de>
parents:
904
diff
changeset
|
55 |
^ self receiver:r selector:s fold:true |
0 | 56 |
! |
57 |
||
15 | 58 |
receiver:r selector:selectorString fold:folding |
59 |
"return a new UnaryNode for sending selector selectorString to receiver r. |
|
11 | 60 |
If folding is true, fold constant expressions." |
61 |
||
4159 | 62 |
|result recVal selector canFold globalName caughtErrorMessage| |
0 | 63 |
|
64 |
" |
|
65 |
The constant folding code can usually not optimize things - this may change |
|
66 |
when some kind of constant declaration is added to smalltalk. |
|
67 |
" |
|
212
ff39051e219f
more constant folding options
Claus Gittinger <cg@exept.de>
parents:
148
diff
changeset
|
68 |
|
ff39051e219f
more constant folding options
Claus Gittinger <cg@exept.de>
parents:
148
diff
changeset
|
69 |
canFold := false. |
ff39051e219f
more constant folding options
Claus Gittinger <cg@exept.de>
parents:
148
diff
changeset
|
70 |
|
993
902eec8d132b
oops - folding argument is not always a symbol.
Claus Gittinger <cg@exept.de>
parents:
991
diff
changeset
|
71 |
(folding notNil and:[folding ~~ false]) ifTrue:[ |
625 | 72 |
selector := selectorString asSymbolIfInterned. |
73 |
selector notNil ifTrue:[ |
|
74 |
"/ |
|
75 |
"/ do constant folding ... |
|
2111 | 76 |
"/ evaluate at compile time: |
77 |
"/ Character tab |
|
78 |
"/ Character cr |
|
3936 | 79 |
"/ ... |
2111 | 80 |
"/ Float pi |
81 |
"/ Float e |
|
3936 | 82 |
"/ ... |
2111 | 83 |
"/ String cr |
84 |
"/ String crlf |
|
3936 | 85 |
"/ ... |
2111 | 86 |
"/ #(...) asFloatArray |
87 |
||
625 | 88 |
r isGlobal ifTrue:[ |
89 |
globalName := r name. |
|
90 |
recVal := r evaluate. |
|
212
ff39051e219f
more constant folding options
Claus Gittinger <cg@exept.de>
parents:
148
diff
changeset
|
91 |
|
625 | 92 |
(globalName = 'Character') ifTrue:[ |
2001 | 93 |
( #( tab cr lf return space backspace esc ) includes:selector) |
625 | 94 |
ifTrue:[ |
95 |
canFold := true |
|
96 |
] |
|
97 |
]. |
|
98 |
(globalName = 'Float') ifTrue:[ |
|
2001 | 99 |
( #( pi e NaN unity zero ) includes:selector) |
625 | 100 |
ifTrue:[ |
101 |
(recVal respondsTo:selector) ifTrue:[ |
|
102 |
canFold := true |
|
103 |
] |
|
104 |
] |
|
105 |
]. |
|
2001 | 106 |
(globalName = 'String') ifTrue:[ |
107 |
( #( cr crlf lf ) includes:selector) |
|
108 |
ifTrue:[ |
|
109 |
(recVal respondsTo:selector) ifTrue:[ |
|
110 |
canFold := true |
|
111 |
] |
|
112 |
] |
|
113 |
]. |
|
114 |
||
1144 | 115 |
"/ no, this 'optimization' is not good - |
116 |
"/ if bytecode is transported to another machine. |
|
117 |
"/ However, the JIT compiler compensates for this ;-) |
|
118 |
"/ (globalName = 'Smalltalk') ifTrue:[ |
|
119 |
"/ ( #( isSmalltalkX isVisualWorks isSqueak |
|
3936 | 120 |
"/ isSmalltalkMT isDolphinSmalltalk isVisualAge |
1144 | 121 |
"/ isSmalltalkV) includes:selector) |
122 |
"/ ifTrue:[ |
|
123 |
"/ (recVal respondsTo:selector) ifTrue:[ |
|
124 |
"/ canFold := true |
|
125 |
"/ ] |
|
126 |
"/ ] |
|
127 |
"/ ]. |
|
128 |
||
625 | 129 |
"/ no, this 'optimization' is not good - |
130 |
"/ if bytecode is transported to another machine. |
|
131 |
"/ However, the JIT compiler compensates for this ;-) |
|
132 |
"/ (globalName = 'SmallInteger') ifTrue:[ |
|
133 |
"/ ( #( minVal maxVal ) includes:selector) |
|
134 |
"/ ifTrue:[ |
|
135 |
"/ (recVal respondsTo:selector) ifTrue:[ |
|
136 |
"/ canFold := true |
|
137 |
"/ ] |
|
138 |
"/ ] |
|
139 |
"/ ] |
|
140 |
]. |
|
212
ff39051e219f
more constant folding options
Claus Gittinger <cg@exept.de>
parents:
148
diff
changeset
|
141 |
|
625 | 142 |
r isConstant ifTrue:[ |
143 |
"check if we can do it ..." |
|
144 |
recVal := r evaluate. |
|
145 |
||
146 |
" |
|
147 |
we could do much more here - but then, we need a dependency from |
|
148 |
the folded selectors method to the method we generate code for ... |
|
3936 | 149 |
limit optimizations to those that will never change |
625 | 150 |
(or, if you change them, it will crash badly anyway ...) |
151 |
" |
|
152 |
recVal respondsToArithmetic ifTrue:[ |
|
153 |
(#( negated abs asPoint degreesToRadians radiansToDegrees |
|
4270 | 154 |
reciprocal) includes:selector) |
625 | 155 |
ifTrue:[ |
156 |
canFold := true |
|
4270 | 157 |
] ifFalse:[ |
158 |
(#(exp ln log sqrt |
|
159 |
arcCos arcSin arcTan sin cos tan) includes:selector) |
|
160 |
ifTrue:[ |
|
161 |
(recVal isKindOf:LargeInteger) ifFalse:[ |
|
162 |
canFold := true |
|
163 |
] |
|
164 |
] |
|
165 |
]. |
|
625 | 166 |
]. |
167 |
recVal isCharacter ifTrue:[ |
|
3936 | 168 |
(#( asciiValue asInteger digitValue asString) includes:selector) |
625 | 169 |
ifTrue:[ |
170 |
canFold := true |
|
171 |
] |
|
172 |
]. |
|
173 |
recVal isString ifTrue:[ |
|
174 |
(selector == #withCRs) ifTrue:[ |
|
993
902eec8d132b
oops - folding argument is not always a symbol.
Claus Gittinger <cg@exept.de>
parents:
991
diff
changeset
|
175 |
canFold := folding isSymbol |
902eec8d132b
oops - folding argument is not always a symbol.
Claus Gittinger <cg@exept.de>
parents:
991
diff
changeset
|
176 |
and:[(folding >= #level2) or:[folding == #full]] |
803 | 177 |
]. |
178 |
(selector == #size) ifTrue:[ |
|
993
902eec8d132b
oops - folding argument is not always a symbol.
Claus Gittinger <cg@exept.de>
parents:
991
diff
changeset
|
179 |
canFold := folding isSymbol |
902eec8d132b
oops - folding argument is not always a symbol.
Claus Gittinger <cg@exept.de>
parents:
991
diff
changeset
|
180 |
and:[(folding >= #level1) or:[folding == #full]] |
1093 | 181 |
]. |
182 |
(selector == #asSymbol) ifTrue:[ |
|
183 |
canFold := folding isSymbol |
|
184 |
and:[(folding >= #level1) or:[folding == #full]] |
|
185 |
]. |
|
625 | 186 |
]. |
187 |
(recVal isMemberOf:Array) ifTrue:[ |
|
188 |
(#(asFloatArray asDoubleArray) includes:selector) ifTrue:[ |
|
993
902eec8d132b
oops - folding argument is not always a symbol.
Claus Gittinger <cg@exept.de>
parents:
991
diff
changeset
|
189 |
canFold := folding isSymbol |
902eec8d132b
oops - folding argument is not always a symbol.
Claus Gittinger <cg@exept.de>
parents:
991
diff
changeset
|
190 |
and:[(folding >= #level2) or:[folding == #full]] |
625 | 191 |
] |
192 |
] |
|
193 |
] |
|
194 |
]. |
|
212
ff39051e219f
more constant folding options
Claus Gittinger <cg@exept.de>
parents:
148
diff
changeset
|
195 |
|
ff39051e219f
more constant folding options
Claus Gittinger <cg@exept.de>
parents:
148
diff
changeset
|
196 |
canFold ifTrue:[ |
625 | 197 |
(recVal respondsTo:selector) ifTrue:[ |
212
ff39051e219f
more constant folding options
Claus Gittinger <cg@exept.de>
parents:
148
diff
changeset
|
198 |
SignalSet anySignal "Number domainErrorSignal" handle:[:ex | |
625 | 199 |
"in case of an error, abort fold and return original" |
4159 | 200 |
caughtErrorMessage := ex description. |
625 | 201 |
ex return |
212
ff39051e219f
more constant folding options
Claus Gittinger <cg@exept.de>
parents:
148
diff
changeset
|
202 |
] do:[ |
625 | 203 |
result := recVal perform:selector. |
204 |
^ ConstantNode type:(ConstantNode typeOfConstant:result) value:result |
|
205 |
]. |
|
212
ff39051e219f
more constant folding options
Claus Gittinger <cg@exept.de>
parents:
148
diff
changeset
|
206 |
"when we reach here, something went wrong (something like 0.0 log)" |
4159 | 207 |
^ ParseErrorNode |
208 |
errorString:(caughtErrorMessage,' - error occurred while evaluating constant expression') |
|
625 | 209 |
]. |
212
ff39051e219f
more constant folding options
Claus Gittinger <cg@exept.de>
parents:
148
diff
changeset
|
210 |
]. |
0 | 211 |
]. |
212
ff39051e219f
more constant folding options
Claus Gittinger <cg@exept.de>
parents:
148
diff
changeset
|
212 |
|
15 | 213 |
^ (self basicNew) receiver:r selector:selectorString args:nil lineno:0 |
625 | 214 |
|
4159 | 215 |
"Modified: / 03-07-2017 / 13:56:31 / cg" |
4270 | 216 |
"Modified: / 25-05-2018 / 16:05:52 / Claus Gittinger" |
0 | 217 |
! ! |
218 |
||
3333 | 219 |
!UnaryNode methodsFor:'accessing'! |
220 |
||
221 |
selectorPartPositions |
|
222 |
selectorPartPositions isNil ifTrue:[ |
|
223 |
selectorPartPositions := Array with: (selectorPosition to: selectorPosition + selector size - 1). |
|
224 |
]. |
|
225 |
^ selectorPartPositions |
|
226 |
||
227 |
"Created: / 19-10-2013 / 23:48:08 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
228 |
! ! |
|
229 |
||
0 | 230 |
!UnaryNode methodsFor:'checks'! |
231 |
||
2094 | 232 |
plausibilityCheckIn:aParser |
0 | 233 |
"check for funny selector - careful to do string compare instead |
4038 | 234 |
of symbol identity compare: I don't want to introduce these as symbols |
0 | 235 |
into the system (would make the '... is nowhere implemented' warning |
3309 | 236 |
go away. |
237 |
TODO: rewite to use lint/lint rules and apply them before accepting" |
|
0 | 238 |
|
1502
de3c4e208b9f
Avoid 'is not a symbol in globalKnown' debug messages from librun
Stefan Vogel <sv@exept.de>
parents:
1500
diff
changeset
|
239 |
|selectorSymbol| |
de3c4e208b9f
Avoid 'is not a symbol in globalKnown' debug messages from librun
Stefan Vogel <sv@exept.de>
parents:
1500
diff
changeset
|
240 |
|
2881
ae13393d1096
- plausibilityCheckIn:aParser
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2866
diff
changeset
|
241 |
"JV@2012-07-06: Do not check if receiver is Java package, |
ae13393d1096
- plausibilityCheckIn:aParser
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2866
diff
changeset
|
242 |
otherwise it reports false-positives when working with Java code" |
ae13393d1096
- plausibilityCheckIn:aParser
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2866
diff
changeset
|
243 |
receiver isJavaPackageReference ifTrue:[ ^ nil ]. |
ae13393d1096
- plausibilityCheckIn:aParser
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2866
diff
changeset
|
244 |
|
1502
de3c4e208b9f
Avoid 'is not a symbol in globalKnown' debug messages from librun
Stefan Vogel <sv@exept.de>
parents:
1500
diff
changeset
|
245 |
selectorSymbol := selector asSymbolIfInterned. |
de3c4e208b9f
Avoid 'is not a symbol in globalKnown' debug messages from librun
Stefan Vogel <sv@exept.de>
parents:
1500
diff
changeset
|
246 |
selectorSymbol notNil ifTrue:[ |
de3c4e208b9f
Avoid 'is not a symbol in globalKnown' debug messages from librun
Stefan Vogel <sv@exept.de>
parents:
1500
diff
changeset
|
247 |
((selectorSymbol == #self) or:[ |
de3c4e208b9f
Avoid 'is not a symbol in globalKnown' debug messages from librun
Stefan Vogel <sv@exept.de>
parents:
1500
diff
changeset
|
248 |
(selectorSymbol == #super) or:[ |
de3c4e208b9f
Avoid 'is not a symbol in globalKnown' debug messages from librun
Stefan Vogel <sv@exept.de>
parents:
1500
diff
changeset
|
249 |
(selectorSymbol == #thisContext) or:[ |
de3c4e208b9f
Avoid 'is not a symbol in globalKnown' debug messages from librun
Stefan Vogel <sv@exept.de>
parents:
1500
diff
changeset
|
250 |
(selectorSymbol == #nil) or:[ |
de3c4e208b9f
Avoid 'is not a symbol in globalKnown' debug messages from librun
Stefan Vogel <sv@exept.de>
parents:
1500
diff
changeset
|
251 |
(selectorSymbol == #true) or:[ |
2227
5b45a572dc15
changed: #plausibilityCheckIn:
Claus Gittinger <cg@exept.de>
parents:
2111
diff
changeset
|
252 |
(selectorSymbol == #false)]]]]]) |
5b45a572dc15
changed: #plausibilityCheckIn:
Claus Gittinger <cg@exept.de>
parents:
2111
diff
changeset
|
253 |
ifTrue:[ |
5b45a572dc15
changed: #plausibilityCheckIn:
Claus Gittinger <cg@exept.de>
parents:
2111
diff
changeset
|
254 |
(aParser alreadyWarnedUnimplementedSelectors includes:selectorSymbol) ifFalse:[ |
5b45a572dc15
changed: #plausibilityCheckIn:
Claus Gittinger <cg@exept.de>
parents:
2111
diff
changeset
|
255 |
aParser alreadyWarnedUnimplementedSelectors add:selectorSymbol. |
5b45a572dc15
changed: #plausibilityCheckIn:
Claus Gittinger <cg@exept.de>
parents:
2111
diff
changeset
|
256 |
^ 'funny selector: ',selectorSymbol allBold,'; possible missing ''.'' or keyword-colon.' |
5b45a572dc15
changed: #plausibilityCheckIn:
Claus Gittinger <cg@exept.de>
parents:
2111
diff
changeset
|
257 |
]. |
5b45a572dc15
changed: #plausibilityCheckIn:
Claus Gittinger <cg@exept.de>
parents:
2111
diff
changeset
|
258 |
]. |
5b45a572dc15
changed: #plausibilityCheckIn:
Claus Gittinger <cg@exept.de>
parents:
2111
diff
changeset
|
259 |
|
5b45a572dc15
changed: #plausibilityCheckIn:
Claus Gittinger <cg@exept.de>
parents:
2111
diff
changeset
|
260 |
(Smalltalk includesKey:selectorSymbol) ifTrue:[ |
4057 | 261 |
( #( void ) includes:selectorSymbol) ifFalse:[ |
262 |
(aParser alreadyWarnedUnimplementedSelectors includes:selectorSymbol) ifFalse:[ |
|
263 |
aParser alreadyWarnedUnimplementedSelectors add:selectorSymbol. |
|
264 |
^ 'funny selector: ',selectorSymbol allBold,' (known as global); possible missing ''.'' or keyword-colon.' |
|
265 |
]. |
|
2094 | 266 |
]. |
1502
de3c4e208b9f
Avoid 'is not a symbol in globalKnown' debug messages from librun
Stefan Vogel <sv@exept.de>
parents:
1500
diff
changeset
|
267 |
]. |
0 | 268 |
]. |
17 | 269 |
|
904 | 270 |
" |
271 |
more to come |
|
272 |
... |
|
273 |
" |
|
274 |
||
2094 | 275 |
^ super plausibilityCheckIn:aParser |
1777 | 276 |
|
277 |
"Modified: / 16-07-2006 / 16:16:25 / cg" |
|
2881
ae13393d1096
- plausibilityCheckIn:aParser
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2866
diff
changeset
|
278 |
"Modified: / 06-07-2012 / 10:46:53 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
0 | 279 |
! ! |
280 |
||
281 |
!UnaryNode methodsFor:'code generation'! |
|
282 |
||
104 | 283 |
codeOn:aStream inBlock:b for:aCompiler |
11 | 284 |
"append bytecode for the receiver to aStream." |
285 |
||
626 | 286 |
|rSel notSelector| |
287 |
||
11 | 288 |
" |
289 |
optimize |
|
626 | 290 |
(a == b) not -> (a ~~ b) |
291 |
(a ~~ b) not -> (a == b) |
|
0 | 292 |
" |
293 |
(selector == #not) ifTrue:[ |
|
626 | 294 |
(receiver class == BinaryNode) ifTrue:[ |
295 |
((rSel := receiver selector) == #==) ifTrue:[ |
|
296 |
notSelector := #~~ |
|
297 |
] ifFalse:[ |
|
298 |
(rSel == #~~) ifTrue:[ |
|
299 |
notSelector := #== |
|
300 |
] |
|
301 |
]. |
|
302 |
notSelector notNil ifTrue:[ |
|
1465
2b2eea66362a
ensure literals of optimized messages are in lit-array
Claus Gittinger <cg@exept.de>
parents:
1387
diff
changeset
|
303 |
aCompiler addLiteral:selector; addLiteral:rSel. |
2b2eea66362a
ensure literals of optimized messages are in lit-array
Claus Gittinger <cg@exept.de>
parents:
1387
diff
changeset
|
304 |
|
1998 | 305 |
(BinaryNode |
306 |
receiver:(receiver receiver) |
|
307 |
selector:notSelector |
|
308 |
arg:(receiver arg)) |
|
309 |
codeOn:aStream |
|
310 |
inBlock:b |
|
311 |
for:aCompiler. |
|
626 | 312 |
^ self |
313 |
] |
|
314 |
] |
|
0 | 315 |
]. |
316 |
||
104 | 317 |
^ super codeOn:aStream inBlock:b for:aCompiler |
626 | 318 |
|
2001 | 319 |
"Modified: / 05-03-2007 / 15:11:35 / cg" |
0 | 320 |
! ! |
321 |
||
1035 | 322 |
!UnaryNode methodsFor:'evaluation'! |
140 | 323 |
|
1384 | 324 |
evaluateIn:anEnvironment |
140 | 325 |
"evaluate the expression represented by the receiver" |
326 |
||
2036
989b8836fc32
do #class inline to avoid #perform:
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
327 |
|r| |
989b8836fc32
do #class inline to avoid #perform:
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
328 |
|
1500
3c4cb012b24b
Lazy conversion of selector strings to symbols.
Stefan Vogel <sv@exept.de>
parents:
1465
diff
changeset
|
329 |
selector := selector asSymbol. |
140 | 330 |
receiver isSuper ifTrue:[ |
1384 | 331 |
^ super evaluateIn:anEnvironment |
140 | 332 |
]. |
2036
989b8836fc32
do #class inline to avoid #perform:
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
333 |
r := receiver evaluateIn:anEnvironment. |
989b8836fc32
do #class inline to avoid #perform:
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
334 |
selector == #class ifTrue:[ |
989b8836fc32
do #class inline to avoid #perform:
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
335 |
^ r class. |
989b8836fc32
do #class inline to avoid #perform:
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
336 |
]. |
989b8836fc32
do #class inline to avoid #perform:
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
337 |
^ r perform:selector |
989b8836fc32
do #class inline to avoid #perform:
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
338 |
|
989b8836fc32
do #class inline to avoid #perform:
Claus Gittinger <cg@exept.de>
parents:
2001
diff
changeset
|
339 |
"Modified: / 04-06-2007 / 17:46:31 / cg" |
140 | 340 |
! ! |
341 |
||
1080 | 342 |
!UnaryNode methodsFor:'printing & storing'! |
0 | 343 |
|
1589 | 344 |
printOn:aStream indent:i |
11 | 345 |
"prettyprint the expression represented by the receiver" |
1589 | 346 |
|
347 |
receiver printOn:aStream indent:i parenthized:(receiver precedence < self precedence). |
|
0 | 348 |
aStream space. |
349 |
selector printString printOn:aStream. |
|
1589 | 350 |
|
351 |
"Modified: / 20-04-2005 / 14:36:26 / cg" |
|
0 | 352 |
! ! |
140 | 353 |
|
354 |
!UnaryNode methodsFor:'queries'! |
|
355 |
||
2322 | 356 |
precedence |
357 |
^ 100 |
|
358 |
||
359 |
"Created: / 20-04-2005 / 14:10:34 / cg" |
|
360 |
! ! |
|
361 |
||
362 |
!UnaryNode methodsFor:'testing'! |
|
363 |
||
2863 | 364 |
isJavaPackageReference |
365 |
"Return true, given node is JAVA class reference in form: |
|
366 |
JAVA package1 package2 |
|
367 |
" |
|
368 |
||
369 |
^receiver isJavaPackageReference |
|
4155 | 370 |
and:[selector isLowercaseFirst |
2866
21be09ac87b1
changed: #isJavaPackageReference
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2863
diff
changeset
|
371 |
and:[selector isUnarySelector]] |
2863 | 372 |
|
373 |
"Created: / 19-04-2012 / 09:52:38 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
4155 | 374 |
"Modified: / 22-06-2017 / 06:57:49 / cg" |
2863 | 375 |
! |
376 |
||
140 | 377 |
isUnaryMessage |
378 |
"return true, if this node is one for a unary message" |
|
626 | 379 |
|
140 | 380 |
^ true |
626 | 381 |
|
382 |
"Modified: 23.10.1997 / 02:05:18 / cg" |
|
140 | 383 |
! ! |
384 |
||
2597 | 385 |
!UnaryNode methodsFor:'visiting'! |
386 |
||
387 |
acceptVisitor:aVisitor |
|
388 |
"Double dispatch back to the visitor, passing my type encoded in |
|
389 |
the selector (visitor pattern)" |
|
390 |
||
391 |
"stub code automatically generated - please change if required" |
|
392 |
||
393 |
^ aVisitor visitUnaryNode:self |
|
394 |
! ! |
|
395 |
||
148 | 396 |
!UnaryNode class methodsFor:'documentation'! |
397 |
||
398 |
version |
|
3936 | 399 |
^ '$Header$' |
2227
5b45a572dc15
changed: #plausibilityCheckIn:
Claus Gittinger <cg@exept.de>
parents:
2111
diff
changeset
|
400 |
! |
5b45a572dc15
changed: #plausibilityCheckIn:
Claus Gittinger <cg@exept.de>
parents:
2111
diff
changeset
|
401 |
|
5b45a572dc15
changed: #plausibilityCheckIn:
Claus Gittinger <cg@exept.de>
parents:
2111
diff
changeset
|
402 |
version_CVS |
3936 | 403 |
^ '$Header$' |
148 | 404 |
! ! |
3309 | 405 |