author | Jan Vrany <jan.vrany@labware.com> |
Thu, 27 Oct 2022 14:53:59 +0100 | |
branch | jv |
changeset 4735 | 3b11fb3ede98 |
parent 4723 | 524785227024 |
permissions | -rw-r--r-- |
0 | 1 |
" |
4 | 2 |
COPYRIGHT (c) 1989 by Claus Gittinger |
4275 | 3 |
COPYRIGHT (c) 2015 Jan Vrany |
4 |
COPYRIGHT (c) 2018 Claus Gittinger |
|
53 | 5 |
All Rights Reserved |
0 | 6 |
|
7 |
This software is furnished under a license and may be used |
|
8 |
only in accordance with the terms of that license and with the |
|
9 |
inclusion of the above copyright notice. This software may not |
|
10 |
be provided or otherwise made available to, or used by, any |
|
11 |
other person. No title to or ownership of the software is |
|
12 |
hereby transferred. |
|
13 |
" |
|
1044 | 14 |
"{ Package: 'stx:libcomp' }" |
15 |
||
3553 | 16 |
"{ NameSpace: Smalltalk }" |
17 |
||
0 | 18 |
Object subclass:#ParseNode |
2550 | 19 |
instanceVariableNames:'parent type comments parenthized startPosition endPosition |
20 |
attributes' |
|
1046 | 21 |
classVariableNames:'' |
244
2ce60e837d52
use dup if possible when pushing args
Claus Gittinger <cg@exept.de>
parents:
148
diff
changeset
|
22 |
poolDictionaries:'' |
2ce60e837d52
use dup if possible when pushing args
Claus Gittinger <cg@exept.de>
parents:
148
diff
changeset
|
23 |
category:'System-Compiler-Support' |
0 | 24 |
! |
25 |
||
20 | 26 |
!ParseNode class methodsFor:'documentation'! |
27 |
||
28 |
copyright |
|
29 |
" |
|
30 |
COPYRIGHT (c) 1989 by Claus Gittinger |
|
4275 | 31 |
COPYRIGHT (c) 2015 Jan Vrany |
32 |
COPYRIGHT (c) 2018 Claus Gittinger |
|
53 | 33 |
All Rights Reserved |
20 | 34 |
|
35 |
This software is furnished under a license and may be used |
|
36 |
only in accordance with the terms of that license and with the |
|
37 |
inclusion of the above copyright notice. This software may not |
|
38 |
be provided or otherwise made available to, or used by, any |
|
39 |
other person. No title to or ownership of the software is |
|
40 |
hereby transferred. |
|
41 |
" |
|
42 |
! |
|
43 |
||
44 |
documentation |
|
45 |
" |
|
46 |
node for parse-trees; abstract class |
|
261 | 47 |
This is a helper class for the compiler. |
263 | 48 |
|
49 |
[author:] |
|
50 |
Claus Gittinger |
|
20 | 51 |
" |
52 |
! ! |
|
0 | 53 |
|
54 |
!ParseNode class methodsFor:'instance creation'! |
|
55 |
||
56 |
type:t |
|
57 |
^ (self basicNew) type:t |
|
58 |
! ! |
|
59 |
||
4471 | 60 |
!ParseNode methodsFor:'RBParser compatibility'! |
61 |
||
4534 | 62 |
bestNodeFor: anInterval |
63 |
(self intersectsInterval: anInterval) ifFalse: [^nil]. |
|
64 |
(self containedBy: anInterval) ifTrue: [^self]. |
|
65 |
||
66 |
self childrenDo:[:each | |
|
67 |
| node | |
|
68 |
node := each bestNodeFor: anInterval. |
|
69 |
node notNil ifTrue: [^node] |
|
70 |
]. |
|
71 |
^ nil |
|
72 |
! |
|
73 |
||
4471 | 74 |
children |
4506 | 75 |
|children| |
76 |
||
77 |
children := OrderedCollection new. |
|
78 |
self childrenDo:[:each | |
|
79 |
self assert:(each notNil). |
|
80 |
children add:each |
|
81 |
]. |
|
82 |
^ children. |
|
83 |
! |
|
84 |
||
85 |
childrenDo:aBlock |
|
86 |
^ self |
|
4471 | 87 |
! |
88 |
||
4522 | 89 |
containedBy:anInterval |
90 |
"true if the interval contains me completely" |
|
91 |
||
4471 | 92 |
startPosition isNil ifTrue:[^ false]. |
93 |
endPosition isNil ifTrue:[^ false]. |
|
94 |
^ anInterval first <= startPosition and:[anInterval last >= endPosition] |
|
95 |
! |
|
96 |
||
97 |
intersectsInterval: anInterval |
|
98 |
|myStart myStop ivStart ivStop| |
|
99 |
||
100 |
myStart := startPosition. |
|
101 |
myStop := endPosition. |
|
102 |
ivStart := anInterval first. |
|
103 |
ivStop := anInterval last. |
|
104 |
(myStart notNil and:[ivStop < myStart]) ifTrue:[^ false]. |
|
105 |
(myStop notNil and:[ivStart > myStop]) ifTrue:[^ false]. |
|
106 |
^ true |
|
107 |
! |
|
108 |
||
109 |
nodesDo:aBlock |
|
110 |
aBlock value: self. |
|
111 |
self children do: [:each | each nodesDo: aBlock] |
|
112 |
! |
|
113 |
||
114 |
start |
|
115 |
"for RBToken compat." |
|
116 |
||
117 |
^ self startPosition |
|
118 |
! |
|
119 |
||
120 |
whichNodeIntersects: anInterval |
|
121 |
| selectedChildren nChildren | |
|
122 |
||
123 |
(self intersectsInterval: anInterval) ifFalse: [^nil]. |
|
124 |
||
125 |
selectedChildren := self children select:[:each | |
|
126 |
each intersectsInterval: anInterval |
|
127 |
]. |
|
128 |
||
129 |
nChildren := selectedChildren size. |
|
130 |
nChildren == 0 ifTrue:[ |
|
131 |
^ self "/ I intersect |
|
132 |
]. |
|
133 |
nChildren == 1 ifTrue:[ |
|
134 |
^ selectedChildren first whichNodeIntersects: anInterval |
|
135 |
]. |
|
136 |
"/ self halt:'should this happen ?'. |
|
137 |
^ self "/ I intersect |
|
138 |
! |
|
139 |
||
4522 | 140 |
whichNodeIsContainedBy:anInterval |
141 |
|firstChildInInterval| |
|
4471 | 142 |
|
143 |
(self intersectsInterval: anInterval) ifFalse: [^nil]. |
|
144 |
(self containedBy: anInterval) ifTrue: [^self]. |
|
145 |
||
4522 | 146 |
self childrenDo:[:each | |
147 |
(each intersectsInterval:anInterval) ifTrue:[ |
|
148 |
firstChildInInterval notNil ifTrue:[ |
|
149 |
"/ ouch: multiple children in interval |
|
150 |
^ self |
|
151 |
]. |
|
152 |
firstChildInInterval := each |
|
153 |
]. |
|
154 |
]. |
|
155 |
||
156 |
firstChildInInterval isNil ifTrue:[ |
|
157 |
"/ no children in interval; so it must be me |
|
4506 | 158 |
^ self |
159 |
]. |
|
4522 | 160 |
"/ look deeper |
161 |
^ firstChildInInterval whichNodeIsContainedBy:anInterval. |
|
4471 | 162 |
! ! |
163 |
||
2819 | 164 |
!ParseNode methodsFor:'accessing'! |
2694 | 165 |
|
2819 | 166 |
enclosingBlock |
167 |
"Return closest enclosing block node or nil" |
|
168 |
||
169 |
| block | |
|
170 |
block := parent. |
|
3485 | 171 |
[ block notNil and:[block realNode isBlockNode not] ] whileTrue:[ |
172 |
block := block realNode parent. |
|
2819 | 173 |
]. |
174 |
^block. |
|
175 |
||
176 |
"Created: / 16-02-2012 / 22:46:12 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
177 |
! |
|
140 | 178 |
|
2505 | 179 |
endPosition |
3542 | 180 |
"the node's last character position in the original source" |
181 |
||
2505 | 182 |
^ endPosition |
183 |
! |
|
184 |
||
2265 | 185 |
endPosition:aCharacterPosition |
4590 | 186 |
self assert:aCharacterPosition > 0. |
2505 | 187 |
|
188 |
endPosition := aCharacterPosition |
|
189 |
||
2618
256319b44ac8
More fixes for start/end position
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2564
diff
changeset
|
190 |
"Modified: / 28-07-2011 / 10:03:53 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
2265 | 191 |
! |
192 |
||
2548 | 193 |
line |
194 |
||
195 |
"Compatibility" |
|
196 |
||
197 |
^self lineNumber |
|
198 |
||
199 |
"Created: / 09-07-2011 / 22:30:38 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
200 |
! |
|
201 |
||
202 |
lineNumber |
|
203 |
||
204 |
^nil |
|
205 |
||
206 |
"Created: / 09-07-2011 / 22:30:57 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
207 |
! |
|
208 |
||
140 | 209 |
lineNumber:dummy |
210 |
"set linenumber - ignored here" |
|
211 |
||
212 |
^ self |
|
213 |
! |
|
214 |
||
2550 | 215 |
parent |
216 |
||
217 |
^parent |
|
218 |
||
219 |
"Created: / 11-07-2011 / 17:36:43 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
220 |
! |
|
221 |
||
222 |
parent: aParseNode |
|
223 |
||
224 |
parent := aParseNode |
|
225 |
||
226 |
"Created: / 11-07-2011 / 17:36:33 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
227 |
! |
|
228 |
||
1990
ede012b2bd5b
oops - parenthesized was written with typo
Claus Gittinger <cg@exept.de>
parents:
1804
diff
changeset
|
229 |
parenthesized |
ede012b2bd5b
oops - parenthesized was written with typo
Claus Gittinger <cg@exept.de>
parents:
1804
diff
changeset
|
230 |
^ parenthized ? false |
ede012b2bd5b
oops - parenthesized was written with typo
Claus Gittinger <cg@exept.de>
parents:
1804
diff
changeset
|
231 |
! |
ede012b2bd5b
oops - parenthesized was written with typo
Claus Gittinger <cg@exept.de>
parents:
1804
diff
changeset
|
232 |
|
ede012b2bd5b
oops - parenthesized was written with typo
Claus Gittinger <cg@exept.de>
parents:
1804
diff
changeset
|
233 |
parenthesized:aBoolean |
ede012b2bd5b
oops - parenthesized was written with typo
Claus Gittinger <cg@exept.de>
parents:
1804
diff
changeset
|
234 |
parenthized := aBoolean |
ede012b2bd5b
oops - parenthesized was written with typo
Claus Gittinger <cg@exept.de>
parents:
1804
diff
changeset
|
235 |
! |
ede012b2bd5b
oops - parenthesized was written with typo
Claus Gittinger <cg@exept.de>
parents:
1804
diff
changeset
|
236 |
|
140 | 237 |
parenthized |
1990
ede012b2bd5b
oops - parenthesized was written with typo
Claus Gittinger <cg@exept.de>
parents:
1804
diff
changeset
|
238 |
"obsolete - typo in message name - use parenthesized" |
ede012b2bd5b
oops - parenthesized was written with typo
Claus Gittinger <cg@exept.de>
parents:
1804
diff
changeset
|
239 |
|
1338 | 240 |
^ parenthized ? false |
140 | 241 |
! |
242 |
||
243 |
parenthized:aBoolean |
|
1990
ede012b2bd5b
oops - parenthesized was written with typo
Claus Gittinger <cg@exept.de>
parents:
1804
diff
changeset
|
244 |
"obsolete - typo in message name - use parenthesized:" |
ede012b2bd5b
oops - parenthesized was written with typo
Claus Gittinger <cg@exept.de>
parents:
1804
diff
changeset
|
245 |
|
140 | 246 |
parenthized := aBoolean |
247 |
! |
|
248 |
||
3483 | 249 |
realNode |
250 |
^ self |
|
251 |
! |
|
252 |
||
3300 | 253 |
selectorPartPositions:selectorPartPositions |
254 |
"/ ignored here, but implemented because sent without checking |
|
255 |
"/ when parsing keyword messages to an optimized messageNode |
|
256 |
"/ (which become optimized to a constantNode by the folder) |
|
257 |
||
258 |
"Created: / 28-08-2013 / 21:17:22 / cg" |
|
259 |
! |
|
260 |
||
598 | 261 |
selectorPosition:aCharacterPosition |
262 |
"ignored here" |
|
263 |
||
264 |
"Created: 5.8.1997 / 16:32:17 / cg" |
|
265 |
! |
|
266 |
||
2505 | 267 |
startPosition |
3542 | 268 |
"the node's character position in the original source" |
269 |
||
2505 | 270 |
^ startPosition |
271 |
! |
|
272 |
||
2550 | 273 |
startPosition:start |
4506 | 274 |
self assert:start > 0. |
2550 | 275 |
startPosition := start |
2505 | 276 |
|
277 |
"Modified: / 08-04-2011 / 22:03:43 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
2265 | 278 |
! |
279 |
||
4506 | 280 |
startPosition:start endPosition:end |
281 |
(start == -1 and:[end == -1]) ifTrue:[ |
|
282 |
"/ a synthetic node |
|
283 |
"/ self halt. |
|
284 |
] ifFalse:[ |
|
4522 | 285 |
"/ nil end means: up-to-end (but only for error nodes) |
4524 | 286 |
self assert:(start notNil and:[start > 0]). |
4522 | 287 |
end isNil ifTrue:[ |
288 |
self assert:(self isErrorNode) |
|
289 |
] ifFalse:[ |
|
290 |
self assert:(end >= start). |
|
291 |
]. |
|
4506 | 292 |
]. |
2550 | 293 |
startPosition := start. |
2564
43f35a40884d
- parse tree nodes are no longer shared
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2550
diff
changeset
|
294 |
endPosition := end. |
2550 | 295 |
|
296 |
"Created: / 11-07-2011 / 17:44:11 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
4352 | 297 |
"Modified: / 15-02-2019 / 14:39:10 / Claus Gittinger" |
2550 | 298 |
! |
299 |
||
140 | 300 |
type |
301 |
"return the nodes type" |
|
302 |
||
303 |
^ type |
|
304 |
! ! |
|
305 |
||
2546
5ae96e911e36
ParseNode: added attributes instvar for other tools to store
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2533
diff
changeset
|
306 |
!ParseNode methodsFor:'attributes access'! |
5ae96e911e36
ParseNode: added attributes instvar for other tools to store
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2533
diff
changeset
|
307 |
|
5ae96e911e36
ParseNode: added attributes instvar for other tools to store
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2533
diff
changeset
|
308 |
objectAttributes |
4680 | 309 |
"return a Collection of attributes - nil if there is none." |
2546
5ae96e911e36
ParseNode: added attributes instvar for other tools to store
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2533
diff
changeset
|
310 |
|
5ae96e911e36
ParseNode: added attributes instvar for other tools to store
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2533
diff
changeset
|
311 |
^attributes |
5ae96e911e36
ParseNode: added attributes instvar for other tools to store
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2533
diff
changeset
|
312 |
|
5ae96e911e36
ParseNode: added attributes instvar for other tools to store
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2533
diff
changeset
|
313 |
"Created: / 09-07-2011 / 12:17:55 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
4680 | 314 |
"Modified (comment): / 18-06-2020 / 12:20:25 / cg" |
2546
5ae96e911e36
ParseNode: added attributes instvar for other tools to store
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2533
diff
changeset
|
315 |
! |
5ae96e911e36
ParseNode: added attributes instvar for other tools to store
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2533
diff
changeset
|
316 |
|
5ae96e911e36
ParseNode: added attributes instvar for other tools to store
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2533
diff
changeset
|
317 |
objectAttributes: anObject |
5ae96e911e36
ParseNode: added attributes instvar for other tools to store
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2533
diff
changeset
|
318 |
|
5ae96e911e36
ParseNode: added attributes instvar for other tools to store
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2533
diff
changeset
|
319 |
attributes := anObject |
5ae96e911e36
ParseNode: added attributes instvar for other tools to store
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2533
diff
changeset
|
320 |
|
5ae96e911e36
ParseNode: added attributes instvar for other tools to store
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2533
diff
changeset
|
321 |
"Created: / 09-07-2011 / 12:18:08 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
5ae96e911e36
ParseNode: added attributes instvar for other tools to store
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2533
diff
changeset
|
322 |
! ! |
5ae96e911e36
ParseNode: added attributes instvar for other tools to store
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2533
diff
changeset
|
323 |
|
140 | 324 |
!ParseNode methodsFor:'checks'! |
325 |
||
2095 | 326 |
plausibilityCheckIn:aParser |
140 | 327 |
^ nil |
328 |
! ! |
|
329 |
||
330 |
!ParseNode methodsFor:'code generation'! |
|
331 |
||
332 |
codeForSideEffectOn:aStream inBlock:b for:aCompiler |
|
333 |
"generate code for this statement - value not needed" |
|
334 |
||
4548 | 335 |
self codeThenDropOn:aStream inBlock:b for:aCompiler |
373 | 336 |
! |
337 |
||
843
522c116f86d9
boolean-return expression rewrite
Claus Gittinger <cg@exept.de>
parents:
816
diff
changeset
|
338 |
codeForSimpleReturnOn:aStream inBlock:b lineNumber:lineNrOrNil for:aCompiler |
522c116f86d9
boolean-return expression rewrite
Claus Gittinger <cg@exept.de>
parents:
816
diff
changeset
|
339 |
"generate code to return myself as a simple method return" |
522c116f86d9
boolean-return expression rewrite
Claus Gittinger <cg@exept.de>
parents:
816
diff
changeset
|
340 |
|
522c116f86d9
boolean-return expression rewrite
Claus Gittinger <cg@exept.de>
parents:
816
diff
changeset
|
341 |
self codeOn:aStream inBlock:b for:aCompiler. |
522c116f86d9
boolean-return expression rewrite
Claus Gittinger <cg@exept.de>
parents:
816
diff
changeset
|
342 |
lineNrOrNil notNil ifTrue:[ |
522c116f86d9
boolean-return expression rewrite
Claus Gittinger <cg@exept.de>
parents:
816
diff
changeset
|
343 |
self codeLineNumber:lineNrOrNil on:aStream for:aCompiler |
522c116f86d9
boolean-return expression rewrite
Claus Gittinger <cg@exept.de>
parents:
816
diff
changeset
|
344 |
]. |
522c116f86d9
boolean-return expression rewrite
Claus Gittinger <cg@exept.de>
parents:
816
diff
changeset
|
345 |
aStream nextPut:#retTop. |
522c116f86d9
boolean-return expression rewrite
Claus Gittinger <cg@exept.de>
parents:
816
diff
changeset
|
346 |
|
522c116f86d9
boolean-return expression rewrite
Claus Gittinger <cg@exept.de>
parents:
816
diff
changeset
|
347 |
|
522c116f86d9
boolean-return expression rewrite
Claus Gittinger <cg@exept.de>
parents:
816
diff
changeset
|
348 |
! |
522c116f86d9
boolean-return expression rewrite
Claus Gittinger <cg@exept.de>
parents:
816
diff
changeset
|
349 |
|
1056 | 350 |
codeInlineOn:aStream inBlock:b valueNeeded:valueNeeded for:aCompiler |
351 |
"generate code for this statement - value is needed" |
|
352 |
||
353 |
self codeOn:aStream inBlock:b for:aCompiler. |
|
354 |
! |
|
355 |
||
3165
7894a735faac
Emit #lineno16 byte codes only, if line number really changes
Stefan Vogel <sv@exept.de>
parents:
3110
diff
changeset
|
356 |
codeLineNumber:nr on:codeStream for:aCompiler |
373 | 357 |
"generate lineNumber information" |
358 |
||
3165
7894a735faac
Emit #lineno16 byte codes only, if line number really changes
Stefan Vogel <sv@exept.de>
parents:
3110
diff
changeset
|
359 |
aCompiler codeLineNumber:nr on:codeStream |
2029 | 360 |
! |
361 |
||
362 |
codeOn:aStream inBlock:codeBlock for:aCompiler |
|
363 |
^ self subclassResponsibility |
|
4548 | 364 |
! |
365 |
||
3645
695fc26d7207
Block source position support [1/2]: generate SOURCEPOS pseudoinstruction before each MAKE_BLOCK insn
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3553
diff
changeset
|
366 |
codeSourcePosition:nr on:codeStream for:aCompiler |
695fc26d7207
Block source position support [1/2]: generate SOURCEPOS pseudoinstruction before each MAKE_BLOCK insn
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3553
diff
changeset
|
367 |
"generate source position information" |
695fc26d7207
Block source position support [1/2]: generate SOURCEPOS pseudoinstruction before each MAKE_BLOCK insn
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3553
diff
changeset
|
368 |
|
695fc26d7207
Block source position support [1/2]: generate SOURCEPOS pseudoinstruction before each MAKE_BLOCK insn
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3553
diff
changeset
|
369 |
aCompiler codeSourcePosition:nr on:codeStream |
695fc26d7207
Block source position support [1/2]: generate SOURCEPOS pseudoinstruction before each MAKE_BLOCK insn
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3553
diff
changeset
|
370 |
|
695fc26d7207
Block source position support [1/2]: generate SOURCEPOS pseudoinstruction before each MAKE_BLOCK insn
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3553
diff
changeset
|
371 |
"Created: / 31-05-2015 / 03:45:10 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
4723 | 372 |
! |
373 |
||
4548 | 374 |
codeThenDropOn:aStream inBlock:b for:aCompiler |
375 |
"generate code for this statement - value not needed" |
|
376 |
||
377 |
self codeOn:aStream inBlock:b for:aCompiler. |
|
378 |
aStream nextPut:#drop |
|
140 | 379 |
! ! |
380 |
||
1804
7c22dbaa8d10
some code savers for common code-emit
Claus Gittinger <cg@exept.de>
parents:
1725
diff
changeset
|
381 |
!ParseNode methodsFor:'code generation helpers'! |
7c22dbaa8d10
some code savers for common code-emit
Claus Gittinger <cg@exept.de>
parents:
1725
diff
changeset
|
382 |
|
7c22dbaa8d10
some code savers for common code-emit
Claus Gittinger <cg@exept.de>
parents:
1725
diff
changeset
|
383 |
emitPushGlobalWithLiteralIndex:litIndex on:aTokenCodeStream for:aCompiler |
7c22dbaa8d10
some code savers for common code-emit
Claus Gittinger <cg@exept.de>
parents:
1725
diff
changeset
|
384 |
litIndex <= 255 ifTrue:[ |
7c22dbaa8d10
some code savers for common code-emit
Claus Gittinger <cg@exept.de>
parents:
1725
diff
changeset
|
385 |
aTokenCodeStream nextPut:#pushGlobalS; nextPut:litIndex |
7c22dbaa8d10
some code savers for common code-emit
Claus Gittinger <cg@exept.de>
parents:
1725
diff
changeset
|
386 |
] ifFalse:[ |
7c22dbaa8d10
some code savers for common code-emit
Claus Gittinger <cg@exept.de>
parents:
1725
diff
changeset
|
387 |
litIndex <= 16rFFFF ifTrue:[ |
7c22dbaa8d10
some code savers for common code-emit
Claus Gittinger <cg@exept.de>
parents:
1725
diff
changeset
|
388 |
aTokenCodeStream nextPut:#pushGlobalL; nextPut:litIndex; nextPut:0 |
7c22dbaa8d10
some code savers for common code-emit
Claus Gittinger <cg@exept.de>
parents:
1725
diff
changeset
|
389 |
] ifFalse:[ |
7c22dbaa8d10
some code savers for common code-emit
Claus Gittinger <cg@exept.de>
parents:
1725
diff
changeset
|
390 |
aTokenCodeStream nextPut:#pushGlobalVL; nextPut:0; nextPut:litIndex; nextPut:0; nextPut:0; nextPut:0 |
7c22dbaa8d10
some code savers for common code-emit
Claus Gittinger <cg@exept.de>
parents:
1725
diff
changeset
|
391 |
]. |
7c22dbaa8d10
some code savers for common code-emit
Claus Gittinger <cg@exept.de>
parents:
1725
diff
changeset
|
392 |
]. |
7c22dbaa8d10
some code savers for common code-emit
Claus Gittinger <cg@exept.de>
parents:
1725
diff
changeset
|
393 |
! |
7c22dbaa8d10
some code savers for common code-emit
Claus Gittinger <cg@exept.de>
parents:
1725
diff
changeset
|
394 |
|
7c22dbaa8d10
some code savers for common code-emit
Claus Gittinger <cg@exept.de>
parents:
1725
diff
changeset
|
395 |
emitPushLiteral:value on:aTokenCodeStream for:aCompiler |
7c22dbaa8d10
some code savers for common code-emit
Claus Gittinger <cg@exept.de>
parents:
1725
diff
changeset
|
396 |
|index| |
7c22dbaa8d10
some code savers for common code-emit
Claus Gittinger <cg@exept.de>
parents:
1725
diff
changeset
|
397 |
|
7c22dbaa8d10
some code savers for common code-emit
Claus Gittinger <cg@exept.de>
parents:
1725
diff
changeset
|
398 |
index := aCompiler addLiteral:value. |
7c22dbaa8d10
some code savers for common code-emit
Claus Gittinger <cg@exept.de>
parents:
1725
diff
changeset
|
399 |
self emitPushLiteralIndex:index on:aTokenCodeStream for:aCompiler |
7c22dbaa8d10
some code savers for common code-emit
Claus Gittinger <cg@exept.de>
parents:
1725
diff
changeset
|
400 |
! |
7c22dbaa8d10
some code savers for common code-emit
Claus Gittinger <cg@exept.de>
parents:
1725
diff
changeset
|
401 |
|
7c22dbaa8d10
some code savers for common code-emit
Claus Gittinger <cg@exept.de>
parents:
1725
diff
changeset
|
402 |
emitPushLiteralIndex:index on:aTokenCodeStream for:aCompiler |
7c22dbaa8d10
some code savers for common code-emit
Claus Gittinger <cg@exept.de>
parents:
1725
diff
changeset
|
403 |
index <= 8 ifTrue:[ |
7c22dbaa8d10
some code savers for common code-emit
Claus Gittinger <cg@exept.de>
parents:
1725
diff
changeset
|
404 |
aTokenCodeStream |
7c22dbaa8d10
some code savers for common code-emit
Claus Gittinger <cg@exept.de>
parents:
1725
diff
changeset
|
405 |
nextPut:(#(pushLit1 pushLit2 pushLit3 pushLit4 |
7c22dbaa8d10
some code savers for common code-emit
Claus Gittinger <cg@exept.de>
parents:
1725
diff
changeset
|
406 |
pushLit5 pushLit6 pushLit7 pushLit8) at:index). |
7c22dbaa8d10
some code savers for common code-emit
Claus Gittinger <cg@exept.de>
parents:
1725
diff
changeset
|
407 |
] ifFalse:[ |
7c22dbaa8d10
some code savers for common code-emit
Claus Gittinger <cg@exept.de>
parents:
1725
diff
changeset
|
408 |
index <= 255 ifTrue:[ |
7c22dbaa8d10
some code savers for common code-emit
Claus Gittinger <cg@exept.de>
parents:
1725
diff
changeset
|
409 |
aTokenCodeStream nextPut:#pushLitS; nextPut:index |
7c22dbaa8d10
some code savers for common code-emit
Claus Gittinger <cg@exept.de>
parents:
1725
diff
changeset
|
410 |
] ifFalse:[ |
7c22dbaa8d10
some code savers for common code-emit
Claus Gittinger <cg@exept.de>
parents:
1725
diff
changeset
|
411 |
index <= 16rFFFF ifTrue:[ |
7c22dbaa8d10
some code savers for common code-emit
Claus Gittinger <cg@exept.de>
parents:
1725
diff
changeset
|
412 |
aTokenCodeStream nextPut:#pushLitL; nextPut:index; nextPut:0 |
7c22dbaa8d10
some code savers for common code-emit
Claus Gittinger <cg@exept.de>
parents:
1725
diff
changeset
|
413 |
] ifFalse:[ |
7c22dbaa8d10
some code savers for common code-emit
Claus Gittinger <cg@exept.de>
parents:
1725
diff
changeset
|
414 |
aTokenCodeStream nextPut:#pushLitVL; nextPut:0; nextPut:index; nextPut:0; nextPut:0; nextPut:0 |
7c22dbaa8d10
some code savers for common code-emit
Claus Gittinger <cg@exept.de>
parents:
1725
diff
changeset
|
415 |
] |
7c22dbaa8d10
some code savers for common code-emit
Claus Gittinger <cg@exept.de>
parents:
1725
diff
changeset
|
416 |
]. |
7c22dbaa8d10
some code savers for common code-emit
Claus Gittinger <cg@exept.de>
parents:
1725
diff
changeset
|
417 |
]. |
7c22dbaa8d10
some code savers for common code-emit
Claus Gittinger <cg@exept.de>
parents:
1725
diff
changeset
|
418 |
! |
7c22dbaa8d10
some code savers for common code-emit
Claus Gittinger <cg@exept.de>
parents:
1725
diff
changeset
|
419 |
|
3165
7894a735faac
Emit #lineno16 byte codes only, if line number really changes
Stefan Vogel <sv@exept.de>
parents:
3110
diff
changeset
|
420 |
emitSendLiteralIndex:litIndex numArgs:nargs line:lineNr on:aStream for:aCompiler |
3110
f517641d3673
Emit LINE16 bytecode insn just before a SEND bytecode is emmited when
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2862
diff
changeset
|
421 |
lineNr >= 255 ifTrue:[ |
3165
7894a735faac
Emit #lineno16 byte codes only, if line number really changes
Stefan Vogel <sv@exept.de>
parents:
3110
diff
changeset
|
422 |
self codeLineNumber: lineNr on: aStream for:aCompiler. |
3110
f517641d3673
Emit LINE16 bytecode insn just before a SEND bytecode is emmited when
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2862
diff
changeset
|
423 |
]. |
1804
7c22dbaa8d10
some code savers for common code-emit
Claus Gittinger <cg@exept.de>
parents:
1725
diff
changeset
|
424 |
(litIndex <= 255) ifTrue:[ |
7c22dbaa8d10
some code savers for common code-emit
Claus Gittinger <cg@exept.de>
parents:
1725
diff
changeset
|
425 |
nargs <= 3 ifTrue:[ |
7c22dbaa8d10
some code savers for common code-emit
Claus Gittinger <cg@exept.de>
parents:
1725
diff
changeset
|
426 |
aStream |
7c22dbaa8d10
some code savers for common code-emit
Claus Gittinger <cg@exept.de>
parents:
1725
diff
changeset
|
427 |
nextPut:(#(send0 send1 send2 send3) at:(nargs+1)); nextPut:lineNr; |
7c22dbaa8d10
some code savers for common code-emit
Claus Gittinger <cg@exept.de>
parents:
1725
diff
changeset
|
428 |
nextPut:litIndex. |
7c22dbaa8d10
some code savers for common code-emit
Claus Gittinger <cg@exept.de>
parents:
1725
diff
changeset
|
429 |
^ self. |
7c22dbaa8d10
some code savers for common code-emit
Claus Gittinger <cg@exept.de>
parents:
1725
diff
changeset
|
430 |
]. |
7c22dbaa8d10
some code savers for common code-emit
Claus Gittinger <cg@exept.de>
parents:
1725
diff
changeset
|
431 |
aStream |
7c22dbaa8d10
some code savers for common code-emit
Claus Gittinger <cg@exept.de>
parents:
1725
diff
changeset
|
432 |
nextPut:#send; nextPut:lineNr; |
7c22dbaa8d10
some code savers for common code-emit
Claus Gittinger <cg@exept.de>
parents:
1725
diff
changeset
|
433 |
nextPut:litIndex; |
7c22dbaa8d10
some code savers for common code-emit
Claus Gittinger <cg@exept.de>
parents:
1725
diff
changeset
|
434 |
nextPut:nargs. |
7c22dbaa8d10
some code savers for common code-emit
Claus Gittinger <cg@exept.de>
parents:
1725
diff
changeset
|
435 |
^ self. |
7c22dbaa8d10
some code savers for common code-emit
Claus Gittinger <cg@exept.de>
parents:
1725
diff
changeset
|
436 |
]. |
7c22dbaa8d10
some code savers for common code-emit
Claus Gittinger <cg@exept.de>
parents:
1725
diff
changeset
|
437 |
|
7c22dbaa8d10
some code savers for common code-emit
Claus Gittinger <cg@exept.de>
parents:
1725
diff
changeset
|
438 |
(litIndex <= 16rFFFF) ifTrue:[ |
7c22dbaa8d10
some code savers for common code-emit
Claus Gittinger <cg@exept.de>
parents:
1725
diff
changeset
|
439 |
aStream |
7c22dbaa8d10
some code savers for common code-emit
Claus Gittinger <cg@exept.de>
parents:
1725
diff
changeset
|
440 |
nextPut:#sendL; nextPut:lineNr; |
7c22dbaa8d10
some code savers for common code-emit
Claus Gittinger <cg@exept.de>
parents:
1725
diff
changeset
|
441 |
nextPut:litIndex; nextPut:0; |
7c22dbaa8d10
some code savers for common code-emit
Claus Gittinger <cg@exept.de>
parents:
1725
diff
changeset
|
442 |
nextPut:nargs. |
7c22dbaa8d10
some code savers for common code-emit
Claus Gittinger <cg@exept.de>
parents:
1725
diff
changeset
|
443 |
^ self. |
7c22dbaa8d10
some code savers for common code-emit
Claus Gittinger <cg@exept.de>
parents:
1725
diff
changeset
|
444 |
]. |
7c22dbaa8d10
some code savers for common code-emit
Claus Gittinger <cg@exept.de>
parents:
1725
diff
changeset
|
445 |
|
7c22dbaa8d10
some code savers for common code-emit
Claus Gittinger <cg@exept.de>
parents:
1725
diff
changeset
|
446 |
aStream |
7c22dbaa8d10
some code savers for common code-emit
Claus Gittinger <cg@exept.de>
parents:
1725
diff
changeset
|
447 |
nextPut:#sendVL; nextPut:0; nextPut:lineNr; |
7c22dbaa8d10
some code savers for common code-emit
Claus Gittinger <cg@exept.de>
parents:
1725
diff
changeset
|
448 |
nextPut:litIndex; nextPut:0; nextPut:0; nextPut:0; |
7c22dbaa8d10
some code savers for common code-emit
Claus Gittinger <cg@exept.de>
parents:
1725
diff
changeset
|
449 |
nextPut:nargs. |
3110
f517641d3673
Emit LINE16 bytecode insn just before a SEND bytecode is emmited when
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2862
diff
changeset
|
450 |
|
f517641d3673
Emit LINE16 bytecode insn just before a SEND bytecode is emmited when
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2862
diff
changeset
|
451 |
"Modified: / 13-04-2013 / 11:02:20 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
1804
7c22dbaa8d10
some code savers for common code-emit
Claus Gittinger <cg@exept.de>
parents:
1725
diff
changeset
|
452 |
! |
7c22dbaa8d10
some code savers for common code-emit
Claus Gittinger <cg@exept.de>
parents:
1725
diff
changeset
|
453 |
|
7c22dbaa8d10
some code savers for common code-emit
Claus Gittinger <cg@exept.de>
parents:
1725
diff
changeset
|
454 |
emitStoreGlobalWithLiteralIndex:litIndex on:aTokenCodeStream for:aCompiler |
7c22dbaa8d10
some code savers for common code-emit
Claus Gittinger <cg@exept.de>
parents:
1725
diff
changeset
|
455 |
litIndex <= 255 ifTrue:[ |
7c22dbaa8d10
some code savers for common code-emit
Claus Gittinger <cg@exept.de>
parents:
1725
diff
changeset
|
456 |
aTokenCodeStream nextPut:#storeGlobalS; nextPut:litIndex |
7c22dbaa8d10
some code savers for common code-emit
Claus Gittinger <cg@exept.de>
parents:
1725
diff
changeset
|
457 |
] ifFalse:[ |
7c22dbaa8d10
some code savers for common code-emit
Claus Gittinger <cg@exept.de>
parents:
1725
diff
changeset
|
458 |
litIndex <= 16rFFFF ifTrue:[ |
7c22dbaa8d10
some code savers for common code-emit
Claus Gittinger <cg@exept.de>
parents:
1725
diff
changeset
|
459 |
aTokenCodeStream nextPut:#storeGlobalL; nextPut:litIndex; nextPut:0 |
7c22dbaa8d10
some code savers for common code-emit
Claus Gittinger <cg@exept.de>
parents:
1725
diff
changeset
|
460 |
] ifFalse:[ |
7c22dbaa8d10
some code savers for common code-emit
Claus Gittinger <cg@exept.de>
parents:
1725
diff
changeset
|
461 |
aTokenCodeStream nextPut:#storeGlobalVL; nextPut:0; nextPut:litIndex; nextPut:0; nextPut:0; nextPut:0; nextPut:0 |
7c22dbaa8d10
some code savers for common code-emit
Claus Gittinger <cg@exept.de>
parents:
1725
diff
changeset
|
462 |
]. |
7c22dbaa8d10
some code savers for common code-emit
Claus Gittinger <cg@exept.de>
parents:
1725
diff
changeset
|
463 |
]. |
7c22dbaa8d10
some code savers for common code-emit
Claus Gittinger <cg@exept.de>
parents:
1725
diff
changeset
|
464 |
! |
7c22dbaa8d10
some code savers for common code-emit
Claus Gittinger <cg@exept.de>
parents:
1725
diff
changeset
|
465 |
|
3165
7894a735faac
Emit #lineno16 byte codes only, if line number really changes
Stefan Vogel <sv@exept.de>
parents:
3110
diff
changeset
|
466 |
emitSuperSendLiteralIndex:litIndex classLiteralIndex:clsLitIndex numArgs:nargs line:lineNr on:aStream for:aCompiler |
3110
f517641d3673
Emit LINE16 bytecode insn just before a SEND bytecode is emmited when
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2862
diff
changeset
|
467 |
lineNr >= 255 ifTrue:[ |
3165
7894a735faac
Emit #lineno16 byte codes only, if line number really changes
Stefan Vogel <sv@exept.de>
parents:
3110
diff
changeset
|
468 |
self codeLineNumber: lineNr on: aStream for:aCompiler. |
3110
f517641d3673
Emit LINE16 bytecode insn just before a SEND bytecode is emmited when
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2862
diff
changeset
|
469 |
]. |
1804
7c22dbaa8d10
some code savers for common code-emit
Claus Gittinger <cg@exept.de>
parents:
1725
diff
changeset
|
470 |
(litIndex <= 255 and:[clsLitIndex <= 255]) ifTrue:[ |
7c22dbaa8d10
some code savers for common code-emit
Claus Gittinger <cg@exept.de>
parents:
1725
diff
changeset
|
471 |
aStream |
7c22dbaa8d10
some code savers for common code-emit
Claus Gittinger <cg@exept.de>
parents:
1725
diff
changeset
|
472 |
nextPut:#superSend; nextPut:lineNr; |
7c22dbaa8d10
some code savers for common code-emit
Claus Gittinger <cg@exept.de>
parents:
1725
diff
changeset
|
473 |
nextPut:litIndex; |
7c22dbaa8d10
some code savers for common code-emit
Claus Gittinger <cg@exept.de>
parents:
1725
diff
changeset
|
474 |
nextPut:nargs; |
7c22dbaa8d10
some code savers for common code-emit
Claus Gittinger <cg@exept.de>
parents:
1725
diff
changeset
|
475 |
nextPut:clsLitIndex. |
7c22dbaa8d10
some code savers for common code-emit
Claus Gittinger <cg@exept.de>
parents:
1725
diff
changeset
|
476 |
] ifFalse:[ |
7c22dbaa8d10
some code savers for common code-emit
Claus Gittinger <cg@exept.de>
parents:
1725
diff
changeset
|
477 |
(litIndex <= 16rFFFF and:[clsLitIndex <= 16rFFFF]) ifTrue:[ |
7c22dbaa8d10
some code savers for common code-emit
Claus Gittinger <cg@exept.de>
parents:
1725
diff
changeset
|
478 |
aStream |
7c22dbaa8d10
some code savers for common code-emit
Claus Gittinger <cg@exept.de>
parents:
1725
diff
changeset
|
479 |
nextPut:#superSendL; nextPut:lineNr; |
7c22dbaa8d10
some code savers for common code-emit
Claus Gittinger <cg@exept.de>
parents:
1725
diff
changeset
|
480 |
nextPut:litIndex; nextPut:0; |
7c22dbaa8d10
some code savers for common code-emit
Claus Gittinger <cg@exept.de>
parents:
1725
diff
changeset
|
481 |
nextPut:nargs; |
7c22dbaa8d10
some code savers for common code-emit
Claus Gittinger <cg@exept.de>
parents:
1725
diff
changeset
|
482 |
nextPut:clsLitIndex; nextPut:0. |
7c22dbaa8d10
some code savers for common code-emit
Claus Gittinger <cg@exept.de>
parents:
1725
diff
changeset
|
483 |
] ifFalse:[ |
7c22dbaa8d10
some code savers for common code-emit
Claus Gittinger <cg@exept.de>
parents:
1725
diff
changeset
|
484 |
aStream |
7c22dbaa8d10
some code savers for common code-emit
Claus Gittinger <cg@exept.de>
parents:
1725
diff
changeset
|
485 |
nextPut:#superSendVL; nextPut:0; nextPut:lineNr; |
7c22dbaa8d10
some code savers for common code-emit
Claus Gittinger <cg@exept.de>
parents:
1725
diff
changeset
|
486 |
nextPut:litIndex; nextPut:0; nextPut:0; nextPut:0; |
7c22dbaa8d10
some code savers for common code-emit
Claus Gittinger <cg@exept.de>
parents:
1725
diff
changeset
|
487 |
nextPut:nargs; |
7c22dbaa8d10
some code savers for common code-emit
Claus Gittinger <cg@exept.de>
parents:
1725
diff
changeset
|
488 |
nextPut:clsLitIndex; nextPut:0; nextPut:0; nextPut:0. |
7c22dbaa8d10
some code savers for common code-emit
Claus Gittinger <cg@exept.de>
parents:
1725
diff
changeset
|
489 |
]. |
7c22dbaa8d10
some code savers for common code-emit
Claus Gittinger <cg@exept.de>
parents:
1725
diff
changeset
|
490 |
]. |
3110
f517641d3673
Emit LINE16 bytecode insn just before a SEND bytecode is emmited when
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2862
diff
changeset
|
491 |
|
f517641d3673
Emit LINE16 bytecode insn just before a SEND bytecode is emmited when
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2862
diff
changeset
|
492 |
"Modified: / 13-04-2013 / 11:01:51 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
1804
7c22dbaa8d10
some code savers for common code-emit
Claus Gittinger <cg@exept.de>
parents:
1725
diff
changeset
|
493 |
! ! |
7c22dbaa8d10
some code savers for common code-emit
Claus Gittinger <cg@exept.de>
parents:
1725
diff
changeset
|
494 |
|
1503 | 495 |
!ParseNode methodsFor:'enumeration'! |
496 |
||
4576 | 497 |
allMessageSelectorsDo:aBlock |
498 |
"evaluate aBlock for each message-node here and in subnodes" |
|
499 |
||
500 |
^ self messageSelectorsDo:aBlock |
|
501 |
! |
|
502 |
||
503 |
allMessagesDo:aBlock |
|
504 |
"evaluate aBlock for each message-node here and in subnodes" |
|
505 |
||
506 |
^ self messagesDo:aBlock |
|
507 |
! |
|
508 |
||
3337 | 509 |
allNodesDo:aBlock |
510 |
"evaluate aBlock for each variable-node here and in subnodes" |
|
511 |
||
4232 | 512 |
aBlock value:self. |
513 |
self allSubNodesDo:aBlock. |
|
514 |
! |
|
515 |
||
516 |
allSubNodesDo:aBlock |
|
4234 | 517 |
"/ self subclassResponsibility. |
3337 | 518 |
! |
519 |
||
4384
aee25576d864
DBG: teach `ByteCodeCompiler` to generate Smalltalk/X debug info
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4275
diff
changeset
|
520 |
blockNodesDo:aBlock recursively: aBoolean |
aee25576d864
DBG: teach `ByteCodeCompiler` to generate Smalltalk/X debug info
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4275
diff
changeset
|
521 |
" |
aee25576d864
DBG: teach `ByteCodeCompiler` to generate Smalltalk/X debug info
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4275
diff
changeset
|
522 |
Evaluate `aBlock` for each `BlockNode` in receicer's subtree. |
aee25576d864
DBG: teach `ByteCodeCompiler` to generate Smalltalk/X debug info
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4275
diff
changeset
|
523 |
|
aee25576d864
DBG: teach `ByteCodeCompiler` to generate Smalltalk/X debug info
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4275
diff
changeset
|
524 |
If, `aBoolean` is true, then recurse into block nodes themselves, |
aee25576d864
DBG: teach `ByteCodeCompiler` to generate Smalltalk/X debug info
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4275
diff
changeset
|
525 |
evaluating `aBlock` for (all) nested blocks. |
aee25576d864
DBG: teach `ByteCodeCompiler` to generate Smalltalk/X debug info
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4275
diff
changeset
|
526 |
If `aBoolean` is false, stop at any block node. |
aee25576d864
DBG: teach `ByteCodeCompiler` to generate Smalltalk/X debug info
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4275
diff
changeset
|
527 |
" |
aee25576d864
DBG: teach `ByteCodeCompiler` to generate Smalltalk/X debug info
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4275
diff
changeset
|
528 |
^ self |
aee25576d864
DBG: teach `ByteCodeCompiler` to generate Smalltalk/X debug info
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4275
diff
changeset
|
529 |
|
aee25576d864
DBG: teach `ByteCodeCompiler` to generate Smalltalk/X debug info
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4275
diff
changeset
|
530 |
"Created: / 15-07-2018 / 10:35:02 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
aee25576d864
DBG: teach `ByteCodeCompiler` to generate Smalltalk/X debug info
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4275
diff
changeset
|
531 |
! |
aee25576d864
DBG: teach `ByteCodeCompiler` to generate Smalltalk/X debug info
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4275
diff
changeset
|
532 |
|
3275
921a8afad859
renamed messagesDo: to messageNodes: do
Claus Gittinger <cg@exept.de>
parents:
3184
diff
changeset
|
533 |
messageNodesDo:aBlock |
921a8afad859
renamed messagesDo: to messageNodes: do
Claus Gittinger <cg@exept.de>
parents:
3184
diff
changeset
|
534 |
"evaluate aBlock for each message-node here and in subnodes" |
921a8afad859
renamed messagesDo: to messageNodes: do
Claus Gittinger <cg@exept.de>
parents:
3184
diff
changeset
|
535 |
|
3315 | 536 |
self messagesDo:aBlock |
3275
921a8afad859
renamed messagesDo: to messageNodes: do
Claus Gittinger <cg@exept.de>
parents:
3184
diff
changeset
|
537 |
! |
921a8afad859
renamed messagesDo: to messageNodes: do
Claus Gittinger <cg@exept.de>
parents:
3184
diff
changeset
|
538 |
|
3276 | 539 |
messageSelectors |
3337 | 540 |
"return a collection of message selectors" |
3276 | 541 |
|
542 |
|setOfSymbols| |
|
543 |
||
544 |
setOfSymbols := Set new. |
|
3279 | 545 |
self messageSelectorsDo:[:each | setOfSymbols add:each ]. |
3276 | 546 |
^ setOfSymbols |
547 |
! |
|
548 |
||
3279 | 549 |
messageSelectorsDo:aBlock |
550 |
"evaluate aBlock for each message-selector here and in subnodes" |
|
551 |
||
552 |
^ self |
|
553 |
! |
|
554 |
||
3275
921a8afad859
renamed messagesDo: to messageNodes: do
Claus Gittinger <cg@exept.de>
parents:
3184
diff
changeset
|
555 |
messages |
3276 | 556 |
"return a collection of messageNodes" |
557 |
||
3275
921a8afad859
renamed messagesDo: to messageNodes: do
Claus Gittinger <cg@exept.de>
parents:
3184
diff
changeset
|
558 |
|setOfMessages| |
921a8afad859
renamed messagesDo: to messageNodes: do
Claus Gittinger <cg@exept.de>
parents:
3184
diff
changeset
|
559 |
|
921a8afad859
renamed messagesDo: to messageNodes: do
Claus Gittinger <cg@exept.de>
parents:
3184
diff
changeset
|
560 |
setOfMessages := Set new. |
3279 | 561 |
self messagesDo:[:each | setOfMessages add:each ]. |
3275
921a8afad859
renamed messagesDo: to messageNodes: do
Claus Gittinger <cg@exept.de>
parents:
3184
diff
changeset
|
562 |
^ setOfMessages |
921a8afad859
renamed messagesDo: to messageNodes: do
Claus Gittinger <cg@exept.de>
parents:
3184
diff
changeset
|
563 |
! |
921a8afad859
renamed messagesDo: to messageNodes: do
Claus Gittinger <cg@exept.de>
parents:
3184
diff
changeset
|
564 |
|
1503 | 565 |
messagesDo:aBlock |
3275
921a8afad859
renamed messagesDo: to messageNodes: do
Claus Gittinger <cg@exept.de>
parents:
3184
diff
changeset
|
566 |
"evaluate aBlock for each message-node here and in subnodes" |
921a8afad859
renamed messagesDo: to messageNodes: do
Claus Gittinger <cg@exept.de>
parents:
3184
diff
changeset
|
567 |
|
1503 | 568 |
^ self |
3315 | 569 |
! |
570 |
||
4506 | 571 |
statements:statements do:aBlock |
572 |
|s| |
|
573 |
||
574 |
statements isNil ifTrue:[^ self]. |
|
575 |
||
576 |
"/ temporary hack |
|
577 |
statements isCollection ifTrue:[ |
|
578 |
statements do:aBlock. |
|
579 |
] ifFalse:[ |
|
580 |
"/ bad hack |
|
581 |
(statements isKindOf:StatementNode) ifTrue:[ |
|
582 |
s := statements. |
|
583 |
[ s notNil ] whileTrue:[ |
|
584 |
aBlock value:s. |
|
585 |
s := s nextStatement |
|
586 |
]. |
|
587 |
] ifFalse:[ |
|
588 |
"/ an innerblock node |
|
589 |
aBlock value:statements. |
|
590 |
]. |
|
591 |
]. |
|
592 |
||
593 |
"Modified: / 10-07-2019 / 02:32:21 / Claus Gittinger" |
|
594 |
! |
|
595 |
||
3315 | 596 |
variableNodesDo:aBlock |
597 |
"evaluate aBlock for each variable-node here and in subnodes" |
|
598 |
||
599 |
^ self |
|
1503 | 600 |
! ! |
601 |
||
140 | 602 |
!ParseNode methodsFor:'evaluation'! |
603 |
||
1383 | 604 |
evaluate |
605 |
^ self evaluateIn:nil |
|
606 |
! |
|
607 |
||
140 | 608 |
evaluateForCascade |
1383 | 609 |
^ self evaluateForCascadeIn:nil |
610 |
! |
|
611 |
||
612 |
evaluateForCascadeIn:anEnvironment |
|
613 |
^ self evaluateIn:anEnvironment |
|
614 |
! |
|
615 |
||
616 |
evaluateIn:anEnvironment |
|
617 |
self subclassResponsibility |
|
2505 | 618 |
! |
619 |
||
620 |
isStatement |
|
621 |
^false. |
|
622 |
||
623 |
"Created: / 22-02-2011 / 16:29:50 / Jakub <zelenja7@fel.cvut.cz>" |
|
140 | 624 |
! ! |
625 |
||
1080 | 626 |
!ParseNode methodsFor:'printing & storing'! |
140 | 627 |
|
628 |
printOn:aStream |
|
914 | 629 |
"append a user printed representation of the receiver to aStream. |
630 |
The format is suitable for a human - not meant to be read back." |
|
631 |
||
140 | 632 |
self printOn:aStream indent:0 |
633 |
! |
|
634 |
||
1588 | 635 |
printOn:aStream indent:indent |
636 |
"append a user printed representation of the receiver to aStream. |
|
637 |
The format is suitable for a human - not meant to be read back." |
|
638 |
||
639 |
self subclassResponsibility |
|
640 |
||
641 |
"Created: / 20-04-2005 / 14:21:46 / cg" |
|
642 |
! |
|
643 |
||
644 |
printOn:aStream indent:indent parenthized:parenthized |
|
645 |
parenthized ifTrue:[ |
|
646 |
aStream nextPutAll:'(' |
|
647 |
]. |
|
648 |
self printOn:aStream indent:indent. |
|
649 |
parenthized ifTrue:[ |
|
650 |
aStream nextPutAll:')' |
|
651 |
]. |
|
652 |
||
653 |
"Created: / 20-04-2005 / 14:21:28 / cg" |
|
4501 | 654 |
! |
655 |
||
656 |
printStatementListOn:aStream indent:i |
|
657 |
self printOn:aStream indent:i |
|
140 | 658 |
! ! |
659 |
||
660 |
!ParseNode methodsFor:'private'! |
|
661 |
||
662 |
type:t |
|
663 |
"set the nodes type" |
|
664 |
||
665 |
type := t |
|
666 |
! ! |
|
667 |
||
0 | 668 |
!ParseNode methodsFor:'queries'! |
669 |
||
244
2ce60e837d52
use dup if possible when pushing args
Claus Gittinger <cg@exept.de>
parents:
148
diff
changeset
|
670 |
canReuseAsArg:anotherNode |
2ce60e837d52
use dup if possible when pushing args
Claus Gittinger <cg@exept.de>
parents:
148
diff
changeset
|
671 |
^ false |
2ce60e837d52
use dup if possible when pushing args
Claus Gittinger <cg@exept.de>
parents:
148
diff
changeset
|
672 |
|
2ce60e837d52
use dup if possible when pushing args
Claus Gittinger <cg@exept.de>
parents:
148
diff
changeset
|
673 |
"Created: 14.4.1996 / 00:43:08 / cg" |
2ce60e837d52
use dup if possible when pushing args
Claus Gittinger <cg@exept.de>
parents:
148
diff
changeset
|
674 |
! |
2ce60e837d52
use dup if possible when pushing args
Claus Gittinger <cg@exept.de>
parents:
148
diff
changeset
|
675 |
|
395 | 676 |
collectBlocksInto:aCollection |
677 |
^ self |
|
678 |
||
679 |
"Created: 23.10.1996 / 15:45:00 / cg" |
|
680 |
! |
|
681 |
||
2382 | 682 |
containsReturn |
683 |
^ false |
|
684 |
! |
|
685 |
||
4506 | 686 |
parseNodeVisitorClass |
687 |
^ ParseNodeVisitor |
|
688 |
! |
|
689 |
||
3296 | 690 |
positionToInsertPeriodForStatementSeparation |
691 |
^ self endPosition + (parenthized == true ifTrue:1 ifFalse:0) |
|
692 |
||
693 |
"Created: 14.4.1996 / 00:43:08 / cg" |
|
694 |
! |
|
695 |
||
2327 | 696 |
precedence |
697 |
^ 9999 |
|
698 |
! |
|
699 |
||
4582 | 700 |
whoDefines:aName |
701 |
"return the node (blockNode) in which this variable is defined. |
|
702 |
(nil if instvar, classvar or global)" |
|
703 |
||
704 |
|p| |
|
705 |
||
706 |
"/ TODO |
|
707 |
"/ block notNil ifTrue:[ |
|
708 |
"/ self halt |
|
709 |
"/ ]. |
|
710 |
p := parent. |
|
711 |
[p notNil and:[p isFunctionNode not and:[p isBlockNode not]]] whileTrue:[ p := p parent]. |
|
712 |
p notNil ifTrue:[ |
|
713 |
((p arguments ? #()) contains:[:var | var name = aName]) ifTrue:[^ p]. |
|
714 |
((p localVariables ? #()) contains:[:var | var name = aName]) ifTrue:[^ p]. |
|
715 |
]. |
|
716 |
^ nil |
|
717 |
! |
|
718 |
||
2327 | 719 |
withConstantValueDo:aBlock |
720 |
"return true, if this evaluates to a constant value |
|
721 |
and evaluate aBlock with it" |
|
722 |
||
723 |
^ false |
|
724 |
! ! |
|
725 |
||
726 |
!ParseNode methodsFor:'testing'! |
|
727 |
||
140 | 728 |
isAssignment |
729 |
"return true, if this is a node for an assignment" |
|
730 |
||
731 |
^ false |
|
732 |
! |
|
733 |
||
734 |
isBinaryMessage |
|
735 |
"return true, if this is a node for a binary send" |
|
736 |
||
737 |
^ false |
|
738 |
! |
|
739 |
||
740 |
isBlockNode |
|
741 |
"return true, if this is a node for a block" |
|
742 |
||
743 |
^ false |
|
744 |
! |
|
745 |
||
2533 | 746 |
isBreakPointNode |
747 |
^ false |
|
748 |
||
749 |
"Created: / 05-07-2011 / 21:14:01 / cg" |
|
750 |
! |
|
751 |
||
744
e871f9f072f8
changes for cascades to super/here semantics.
Claus Gittinger <cg@exept.de>
parents:
598
diff
changeset
|
752 |
isCascade |
e871f9f072f8
changes for cascades to super/here semantics.
Claus Gittinger <cg@exept.de>
parents:
598
diff
changeset
|
753 |
^ false |
e871f9f072f8
changes for cascades to super/here semantics.
Claus Gittinger <cg@exept.de>
parents:
598
diff
changeset
|
754 |
|
e871f9f072f8
changes for cascades to super/here semantics.
Claus Gittinger <cg@exept.de>
parents:
598
diff
changeset
|
755 |
"Created: / 16.7.1998 / 20:11:33 / cg" |
e871f9f072f8
changes for cascades to super/here semantics.
Claus Gittinger <cg@exept.de>
parents:
598
diff
changeset
|
756 |
! |
e871f9f072f8
changes for cascades to super/here semantics.
Claus Gittinger <cg@exept.de>
parents:
598
diff
changeset
|
757 |
|
e871f9f072f8
changes for cascades to super/here semantics.
Claus Gittinger <cg@exept.de>
parents:
598
diff
changeset
|
758 |
isCascadeToSuper |
e871f9f072f8
changes for cascades to super/here semantics.
Claus Gittinger <cg@exept.de>
parents:
598
diff
changeset
|
759 |
^ false |
e871f9f072f8
changes for cascades to super/here semantics.
Claus Gittinger <cg@exept.de>
parents:
598
diff
changeset
|
760 |
|
e871f9f072f8
changes for cascades to super/here semantics.
Claus Gittinger <cg@exept.de>
parents:
598
diff
changeset
|
761 |
"Created: / 16.7.1998 / 19:51:07 / cg" |
e871f9f072f8
changes for cascades to super/here semantics.
Claus Gittinger <cg@exept.de>
parents:
598
diff
changeset
|
762 |
! |
e871f9f072f8
changes for cascades to super/here semantics.
Claus Gittinger <cg@exept.de>
parents:
598
diff
changeset
|
763 |
|
0 | 764 |
isConstant |
13 | 765 |
"return true, if this is a node for a constant" |
766 |
||
767 |
^ false |
|
768 |
! |
|
769 |
||
4277 | 770 |
isConstantNumber |
771 |
"return true, if this is a node for a constant number" |
|
772 |
||
773 |
^ false |
|
774 |
||
775 |
"Created: / 16-06-2018 / 08:47:03 / Claus Gittinger" |
|
776 |
! |
|
777 |
||
1533 | 778 |
isErrorNode |
779 |
^ false |
|
780 |
! |
|
781 |
||
4322 | 782 |
isFunctionCallNode |
783 |
^ false |
|
784 |
||
785 |
"Created: / 13-12-2018 / 22:35:28 / Claus Gittinger" |
|
786 |
! |
|
787 |
||
4330 | 788 |
isFunctionNode |
789 |
^ false |
|
790 |
||
791 |
"Created: / 08-02-2019 / 10:53:58 / Claus Gittinger" |
|
792 |
! |
|
793 |
||
53 | 794 |
isGlobal |
795 |
"return true, if this is a node for a global variable" |
|
796 |
||
797 |
^ false |
|
798 |
! |
|
799 |
||
2000 | 800 |
isGlobalNamed:globalName |
801 |
"return true, if this is a node for a particular global variable" |
|
802 |
||
803 |
^ false |
|
804 |
||
805 |
"Created: / 05-03-2007 / 15:13:23 / cg" |
|
806 |
! |
|
807 |
||
1310
feb30ab0c221
better variabletype queries.
Claus Gittinger <cg@exept.de>
parents:
1114
diff
changeset
|
808 |
isGlobalVariable |
feb30ab0c221
better variabletype queries.
Claus Gittinger <cg@exept.de>
parents:
1114
diff
changeset
|
809 |
^ false |
feb30ab0c221
better variabletype queries.
Claus Gittinger <cg@exept.de>
parents:
1114
diff
changeset
|
810 |
! |
feb30ab0c221
better variabletype queries.
Claus Gittinger <cg@exept.de>
parents:
1114
diff
changeset
|
811 |
|
1528 | 812 |
isImmutable |
813 |
"not used with ST/X - |
|
814 |
for JavaScript nodes return true here." |
|
815 |
||
816 |
^ true |
|
817 |
! |
|
818 |
||
2403
79c95fae81e8
added: #isImplicitJavaScriptMessage
Claus Gittinger <cg@exept.de>
parents:
2402
diff
changeset
|
819 |
isImplicitJavaScriptMessage |
79c95fae81e8
added: #isImplicitJavaScriptMessage
Claus Gittinger <cg@exept.de>
parents:
2402
diff
changeset
|
820 |
"return true, if this is a node for an implicit getter/setter send" |
79c95fae81e8
added: #isImplicitJavaScriptMessage
Claus Gittinger <cg@exept.de>
parents:
2402
diff
changeset
|
821 |
|
79c95fae81e8
added: #isImplicitJavaScriptMessage
Claus Gittinger <cg@exept.de>
parents:
2402
diff
changeset
|
822 |
^ false |
79c95fae81e8
added: #isImplicitJavaScriptMessage
Claus Gittinger <cg@exept.de>
parents:
2402
diff
changeset
|
823 |
|
79c95fae81e8
added: #isImplicitJavaScriptMessage
Claus Gittinger <cg@exept.de>
parents:
2402
diff
changeset
|
824 |
"Created: / 05-07-2010 / 14:11:41 / cg" |
79c95fae81e8
added: #isImplicitJavaScriptMessage
Claus Gittinger <cg@exept.de>
parents:
2402
diff
changeset
|
825 |
! |
79c95fae81e8
added: #isImplicitJavaScriptMessage
Claus Gittinger <cg@exept.de>
parents:
2402
diff
changeset
|
826 |
|
4237 | 827 |
isInnerFunction |
828 |
^ false |
|
829 |
! |
|
830 |
||
1725 | 831 |
isInnerJavaScriptBlock |
832 |
^ false |
|
833 |
! |
|
834 |
||
2862 | 835 |
isJAVA |
836 |
"Return true, if receiver is global variable node JAVA. |
|
837 |
Used to highlight Java class references." |
|
838 |
||
839 |
^false |
|
840 |
||
841 |
"Created: / 19-04-2012 / 09:36:31 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
842 |
! |
|
843 |
||
844 |
isJavaPackageReference |
|
845 |
"Return true, given node is JAVA package reference in form: |
|
846 |
JAVA package1 package2 |
|
847 |
" |
|
848 |
||
849 |
^false |
|
850 |
||
851 |
"Created: / 19-04-2012 / 09:53:21 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
852 |
! |
|
853 |
||
3184 | 854 |
isJavaScriptAndExpression |
855 |
^ false |
|
856 |
! |
|
857 |
||
2402
da3d16a4193d
changed: #testplanItem:groupPattern:executor:testPlanExecutor:
Claus Gittinger <cg@exept.de>
parents:
2401
diff
changeset
|
858 |
isJavaScriptArrayAccess |
da3d16a4193d
changed: #testplanItem:groupPattern:executor:testPlanExecutor:
Claus Gittinger <cg@exept.de>
parents:
2401
diff
changeset
|
859 |
"return true, if this is a node for a javascript array reference i.e. expr[]" |
da3d16a4193d
changed: #testplanItem:groupPattern:executor:testPlanExecutor:
Claus Gittinger <cg@exept.de>
parents:
2401
diff
changeset
|
860 |
|
da3d16a4193d
changed: #testplanItem:groupPattern:executor:testPlanExecutor:
Claus Gittinger <cg@exept.de>
parents:
2401
diff
changeset
|
861 |
^ false |
da3d16a4193d
changed: #testplanItem:groupPattern:executor:testPlanExecutor:
Claus Gittinger <cg@exept.de>
parents:
2401
diff
changeset
|
862 |
|
da3d16a4193d
changed: #testplanItem:groupPattern:executor:testPlanExecutor:
Claus Gittinger <cg@exept.de>
parents:
2401
diff
changeset
|
863 |
"Created: / 05-07-2010 / 14:04:27 / cg" |
da3d16a4193d
changed: #testplanItem:groupPattern:executor:testPlanExecutor:
Claus Gittinger <cg@exept.de>
parents:
2401
diff
changeset
|
864 |
! |
da3d16a4193d
changed: #testplanItem:groupPattern:executor:testPlanExecutor:
Claus Gittinger <cg@exept.de>
parents:
2401
diff
changeset
|
865 |
|
2400 | 866 |
isJavaScriptBlock |
867 |
"return true, if this is a node for a javascript block" |
|
868 |
||
869 |
^ false |
|
870 |
||
871 |
"Created: / 09-06-2010 / 01:53:19 / cg" |
|
872 |
! |
|
873 |
||
3438 | 874 |
isJavaScriptClassNode |
875 |
^ false |
|
876 |
! |
|
877 |
||
2401
3bfe65bdcc64
added: #isJavaScriptConditionalExpression
Claus Gittinger <cg@exept.de>
parents:
2400
diff
changeset
|
878 |
isJavaScriptConditionalExpression |
3bfe65bdcc64
added: #isJavaScriptConditionalExpression
Claus Gittinger <cg@exept.de>
parents:
2400
diff
changeset
|
879 |
"return true, if this is a node for a ?: expression" |
3bfe65bdcc64
added: #isJavaScriptConditionalExpression
Claus Gittinger <cg@exept.de>
parents:
2400
diff
changeset
|
880 |
|
3bfe65bdcc64
added: #isJavaScriptConditionalExpression
Claus Gittinger <cg@exept.de>
parents:
2400
diff
changeset
|
881 |
^ false |
3bfe65bdcc64
added: #isJavaScriptConditionalExpression
Claus Gittinger <cg@exept.de>
parents:
2400
diff
changeset
|
882 |
|
3bfe65bdcc64
added: #isJavaScriptConditionalExpression
Claus Gittinger <cg@exept.de>
parents:
2400
diff
changeset
|
883 |
"Created: / 09-06-2010 / 01:55:15 / cg" |
3bfe65bdcc64
added: #isJavaScriptConditionalExpression
Claus Gittinger <cg@exept.de>
parents:
2400
diff
changeset
|
884 |
! |
3bfe65bdcc64
added: #isJavaScriptConditionalExpression
Claus Gittinger <cg@exept.de>
parents:
2400
diff
changeset
|
885 |
|
3184 | 886 |
isJavaScriptOrExpression |
887 |
^ false |
|
888 |
! |
|
889 |
||
3812 | 890 |
isLiteral |
891 |
"for compatibility with RB-AST" |
|
892 |
||
893 |
^ self isConstant |
|
894 |
! |
|
895 |
||
4471 | 896 |
isLiteralArray |
897 |
"for compatibility with RB-AST" |
|
898 |
||
899 |
^ false |
|
900 |
! |
|
901 |
||
902 |
isLiteralCString |
|
903 |
"for compatibility with RB-AST" |
|
904 |
||
905 |
^ false |
|
906 |
! |
|
907 |
||
3474 | 908 |
isLocalVariable |
909 |
^ false |
|
910 |
! |
|
911 |
||
140 | 912 |
isMessage |
913 |
"return true, if this is a node for a message expression" |
|
19 | 914 |
|
915 |
^ false |
|
916 |
! |
|
917 |
||
3414 | 918 |
isMethodNode |
919 |
^ false |
|
920 |
! |
|
921 |
||
1310
feb30ab0c221
better variabletype queries.
Claus Gittinger <cg@exept.de>
parents:
1114
diff
changeset
|
922 |
isMethodVariable |
feb30ab0c221
better variabletype queries.
Claus Gittinger <cg@exept.de>
parents:
1114
diff
changeset
|
923 |
^ false |
feb30ab0c221
better variabletype queries.
Claus Gittinger <cg@exept.de>
parents:
1114
diff
changeset
|
924 |
! |
feb30ab0c221
better variabletype queries.
Claus Gittinger <cg@exept.de>
parents:
1114
diff
changeset
|
925 |
|
2327 | 926 |
isNew |
927 |
"return true, if this is a new XXXX node" |
|
928 |
||
929 |
^ false |
|
930 |
! |
|
931 |
||
2088 | 932 |
isPostIncDec |
933 |
"for JavaScript" |
|
934 |
||
935 |
^ false |
|
936 |
! |
|
937 |
||
938 |
isPreIncDec |
|
939 |
"for JavaScript" |
|
940 |
||
941 |
^ false |
|
942 |
! |
|
943 |
||
140 | 944 |
isPrimary |
945 |
"return true, if this is a node for a primary (i.e. non-send)" |
|
13 | 946 |
|
947 |
^ false |
|
948 |
! |
|
949 |
||
950 |
isReturnNode |
|
951 |
"return true, if this is a node for a return expression" |
|
952 |
||
0 | 953 |
^ false |
954 |
! |
|
955 |
||
862 | 956 |
isSelf |
957 |
"return true, if this is a self-node" |
|
958 |
||
959 |
^ false |
|
960 |
! |
|
961 |
||
4541 | 962 |
isSequence |
963 |
"return true, if this is a sequence node (JS)" |
|
964 |
||
965 |
^ false |
|
966 |
! |
|
967 |
||
2505 | 968 |
isStatementNode |
969 |
"return true, if this is a statement node" |
|
970 |
||
971 |
^ false |
|
972 |
||
973 |
"Created: / 13-06-2011 / 11:26:10 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
974 |
! |
|
975 |
||
140 | 976 |
isSuper |
977 |
"return true, if this is a super-node" |
|
13 | 978 |
|
0 | 979 |
^ false |
980 |
! |
|
981 |
||
4718 | 982 |
isSynthetic |
4719 | 983 |
"true if I am a synthetic node (generated from embedded expression strings)" |
984 |
||
4718 | 985 |
^ false |
986 |
! |
|
987 |
||
2089 | 988 |
isThis |
989 |
"for JavaScript" |
|
990 |
||
991 |
^ false |
|
992 |
! |
|
993 |
||
0 | 994 |
isUnaryMessage |
13 | 995 |
"return true, if this is a node for a unary send" |
996 |
||
0 | 997 |
^ false |
244
2ce60e837d52
use dup if possible when pushing args
Claus Gittinger <cg@exept.de>
parents:
148
diff
changeset
|
998 |
! |
2ce60e837d52
use dup if possible when pushing args
Claus Gittinger <cg@exept.de>
parents:
148
diff
changeset
|
999 |
|
2ce60e837d52
use dup if possible when pushing args
Claus Gittinger <cg@exept.de>
parents:
148
diff
changeset
|
1000 |
isVariable |
2ce60e837d52
use dup if possible when pushing args
Claus Gittinger <cg@exept.de>
parents:
148
diff
changeset
|
1001 |
"return true, if this is a node for a variable" |
2ce60e837d52
use dup if possible when pushing args
Claus Gittinger <cg@exept.de>
parents:
148
diff
changeset
|
1002 |
|
2ce60e837d52
use dup if possible when pushing args
Claus Gittinger <cg@exept.de>
parents:
148
diff
changeset
|
1003 |
^ false |
2ce60e837d52
use dup if possible when pushing args
Claus Gittinger <cg@exept.de>
parents:
148
diff
changeset
|
1004 |
|
2ce60e837d52
use dup if possible when pushing args
Claus Gittinger <cg@exept.de>
parents:
148
diff
changeset
|
1005 |
"Created: 14.4.1996 / 00:46:44 / cg" |
2694 | 1006 |
! |
1007 |
||
1008 |
isVariableNode |
|
1009 |
"return true, if this is a node for a variable" |
|
1010 |
||
1011 |
^ self isVariable |
|
1012 |
||
1013 |
"Created: / 12-09-2011 / 09:32:17 / cg" |
|
0 | 1014 |
! ! |
1015 |
||
148 | 1016 |
!ParseNode class methodsFor:'documentation'! |
1017 |
||
3276 | 1018 |
version |
3812 | 1019 |
^ '$Header$' |
3276 | 1020 |
! |
1021 |
||
2505 | 1022 |
version_CVS |
3812 | 1023 |
^ '$Header$' |
148 | 1024 |
! ! |
3110
f517641d3673
Emit LINE16 bytecode insn just before a SEND bytecode is emmited when
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2862
diff
changeset
|
1025 |