author | Jan Vrany <jan.vrany@fit.cvut.cz> |
Tue, 28 Jun 2011 22:17:34 +0200 | |
changeset 2509 | e1f0d934f953 |
parent 2318 | 789c145fb05a |
child 2603 | 342b2361b791 |
permissions | -rw-r--r-- |
0 | 1 |
" |
4 | 2 |
COPYRIGHT (c) 1989 by Claus Gittinger |
52 | 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 |
" |
|
1046 | 12 |
"{ Package: 'stx:libcomp' }" |
13 |
||
0 | 14 |
ParseNode subclass:#AssignmentNode |
2509 | 15 |
instanceVariableNames:'variable expression lineNr endLineNr endCharPosition' |
219
6b977f472cda
care for block-stores into outer contexts
Claus Gittinger <cg@exept.de>
parents:
148
diff
changeset
|
16 |
classVariableNames:'' |
6b977f472cda
care for block-stores into outer contexts
Claus Gittinger <cg@exept.de>
parents:
148
diff
changeset
|
17 |
poolDictionaries:'' |
6b977f472cda
care for block-stores into outer contexts
Claus Gittinger <cg@exept.de>
parents:
148
diff
changeset
|
18 |
category:'System-Compiler-Support' |
0 | 19 |
! |
20 |
||
20 | 21 |
!AssignmentNode class methodsFor:'documentation'! |
22 |
||
23 |
copyright |
|
24 |
" |
|
25 |
COPYRIGHT (c) 1989 by Claus Gittinger |
|
52 | 26 |
All Rights Reserved |
20 | 27 |
|
28 |
This software is furnished under a license and may be used |
|
29 |
only in accordance with the terms of that license and with the |
|
30 |
inclusion of the above copyright notice. This software may not |
|
31 |
be provided or otherwise made available to, or used by, any |
|
32 |
other person. No title to or ownership of the software is |
|
33 |
hereby transferred. |
|
34 |
" |
|
35 |
! |
|
36 |
||
37 |
documentation |
|
38 |
" |
|
261 | 39 |
node for parse-trees, representing assignments. |
40 |
This is a helper class for the compiler. |
|
263 | 41 |
|
42 |
[author:] |
|
43 |
Claus Gittinger |
|
44 |
||
20 | 45 |
" |
46 |
! ! |
|
0 | 47 |
|
48 |
!AssignmentNode class methodsFor:'instance creation'! |
|
49 |
||
50 |
variable:v expression:e |
|
51 |
^ (self basicNew) variable:v expression:e |
|
52 |
! ! |
|
53 |
||
140 | 54 |
!AssignmentNode methodsFor:'accessing'! |
0 | 55 |
|
2509 | 56 |
endCharPosition |
57 |
^ endCharPosition |
|
58 |
! |
|
59 |
||
60 |
endCharPosition:something |
|
61 |
endCharPosition := something. |
|
62 |
! |
|
63 |
||
64 |
endLineNr |
|
65 |
^ endLineNr |
|
66 |
! |
|
67 |
||
68 |
endLineNr:something |
|
69 |
endLineNr := something. |
|
70 |
! |
|
71 |
||
140 | 72 |
expression |
73 |
^ expression |
|
74 |
! |
|
0 | 75 |
|
2509 | 76 |
expression:something |
77 |
expression := something. |
|
78 |
! |
|
79 |
||
80 |
lineNr |
|
81 |
^ lineNr |
|
82 |
! |
|
83 |
||
84 |
lineNr:something |
|
85 |
lineNr := something. |
|
86 |
! |
|
87 |
||
711 | 88 |
lineNumber |
375 | 89 |
"return lineNr" |
90 |
||
91 |
^ lineNr |
|
92 |
||
711 | 93 |
"Created: / 14.5.1998 / 19:30:49 / cg" |
375 | 94 |
! |
95 |
||
711 | 96 |
lineNumber:something |
375 | 97 |
"set lineNr" |
98 |
||
99 |
lineNr := something. |
|
100 |
||
711 | 101 |
"Created: / 14.5.1998 / 19:30:54 / cg" |
375 | 102 |
! |
103 |
||
542 | 104 |
variable |
105 |
^ variable |
|
106 |
||
107 |
"Created: 19.6.1997 / 17:08:58 / cg" |
|
108 |
! |
|
109 |
||
2509 | 110 |
variable:something |
111 |
variable := something. |
|
112 |
! |
|
113 |
||
0 | 114 |
variable:v expression:e |
2509 | 115 |
|
0 | 116 |
variable := v. |
882
0bc2a6ecdfad
oops - cannot inline blocks which are assigned or returned.
Claus Gittinger <cg@exept.de>
parents:
876
diff
changeset
|
117 |
expression := e. |
0bc2a6ecdfad
oops - cannot inline blocks which are assigned or returned.
Claus Gittinger <cg@exept.de>
parents:
876
diff
changeset
|
118 |
|
0bc2a6ecdfad
oops - cannot inline blocks which are assigned or returned.
Claus Gittinger <cg@exept.de>
parents:
876
diff
changeset
|
119 |
"/ any block, which gets assigned to something |
0bc2a6ecdfad
oops - cannot inline blocks which are assigned or returned.
Claus Gittinger <cg@exept.de>
parents:
876
diff
changeset
|
120 |
"/ cannot be inlined. |
2075
d1a4cd5ab035
changed #variable:expression:
Claus Gittinger <cg@exept.de>
parents:
1806
diff
changeset
|
121 |
(e notNil and:[e isBlockNode]) ifTrue:[ |
882
0bc2a6ecdfad
oops - cannot inline blocks which are assigned or returned.
Claus Gittinger <cg@exept.de>
parents:
876
diff
changeset
|
122 |
e possiblyInlined:false |
0bc2a6ecdfad
oops - cannot inline blocks which are assigned or returned.
Claus Gittinger <cg@exept.de>
parents:
876
diff
changeset
|
123 |
] |
2509 | 124 |
|
125 |
"Modified: / 22-02-2011 / 12:52:56 / Jakub <zelenja7@fel.cvut.cz>" |
|
0 | 126 |
! ! |
127 |
||
128 |
!AssignmentNode methodsFor:'code generation'! |
|
129 |
||
117 | 130 |
checkIncDecOn:aStream |
219
6b977f472cda
care for block-stores into outer contexts
Claus Gittinger <cg@exept.de>
parents:
148
diff
changeset
|
131 |
"check if we can use incMvar / decMvar instruction. |
6b977f472cda
care for block-stores into outer contexts
Claus Gittinger <cg@exept.de>
parents:
148
diff
changeset
|
132 |
If so, code it and return true. |
6b977f472cda
care for block-stores into outer contexts
Claus Gittinger <cg@exept.de>
parents:
148
diff
changeset
|
133 |
Otherwise, return false." |
6b977f472cda
care for block-stores into outer contexts
Claus Gittinger <cg@exept.de>
parents:
148
diff
changeset
|
134 |
|
117 | 135 |
|sel erec arg code| |
0 | 136 |
|
137 |
(variable type == #MethodVariable) ifTrue:[ |
|
219
6b977f472cda
care for block-stores into outer contexts
Claus Gittinger <cg@exept.de>
parents:
148
diff
changeset
|
138 |
expression isBinaryMessage ifTrue:[ |
6b977f472cda
care for block-stores into outer contexts
Claus Gittinger <cg@exept.de>
parents:
148
diff
changeset
|
139 |
sel := expression selector. |
6b977f472cda
care for block-stores into outer contexts
Claus Gittinger <cg@exept.de>
parents:
148
diff
changeset
|
140 |
erec := expression receiver. |
6b977f472cda
care for block-stores into outer contexts
Claus Gittinger <cg@exept.de>
parents:
148
diff
changeset
|
141 |
|
6b977f472cda
care for block-stores into outer contexts
Claus Gittinger <cg@exept.de>
parents:
148
diff
changeset
|
142 |
((sel == #+) or:[sel == #-]) ifTrue:[ |
6b977f472cda
care for block-stores into outer contexts
Claus Gittinger <cg@exept.de>
parents:
148
diff
changeset
|
143 |
(erec type == #MethodVariable) ifTrue:[ |
6b977f472cda
care for block-stores into outer contexts
Claus Gittinger <cg@exept.de>
parents:
148
diff
changeset
|
144 |
(erec index == variable index) ifTrue:[ |
6b977f472cda
care for block-stores into outer contexts
Claus Gittinger <cg@exept.de>
parents:
148
diff
changeset
|
145 |
arg := expression arg1. |
6b977f472cda
care for block-stores into outer contexts
Claus Gittinger <cg@exept.de>
parents:
148
diff
changeset
|
146 |
arg isConstant ifTrue:[ |
6b977f472cda
care for block-stores into outer contexts
Claus Gittinger <cg@exept.de>
parents:
148
diff
changeset
|
147 |
(arg value == 1) ifTrue:[ |
6b977f472cda
care for block-stores into outer contexts
Claus Gittinger <cg@exept.de>
parents:
148
diff
changeset
|
148 |
(sel == #+) ifTrue:[ |
6b977f472cda
care for block-stores into outer contexts
Claus Gittinger <cg@exept.de>
parents:
148
diff
changeset
|
149 |
code := #incMethodVar |
6b977f472cda
care for block-stores into outer contexts
Claus Gittinger <cg@exept.de>
parents:
148
diff
changeset
|
150 |
] ifFalse:[ |
6b977f472cda
care for block-stores into outer contexts
Claus Gittinger <cg@exept.de>
parents:
148
diff
changeset
|
151 |
code := #decMethodVar |
6b977f472cda
care for block-stores into outer contexts
Claus Gittinger <cg@exept.de>
parents:
148
diff
changeset
|
152 |
]. |
6b977f472cda
care for block-stores into outer contexts
Claus Gittinger <cg@exept.de>
parents:
148
diff
changeset
|
153 |
aStream nextPut:code; nextPut:(expression lineNumber); nextPut:(variable index). |
6b977f472cda
care for block-stores into outer contexts
Claus Gittinger <cg@exept.de>
parents:
148
diff
changeset
|
154 |
^ true |
6b977f472cda
care for block-stores into outer contexts
Claus Gittinger <cg@exept.de>
parents:
148
diff
changeset
|
155 |
] |
6b977f472cda
care for block-stores into outer contexts
Claus Gittinger <cg@exept.de>
parents:
148
diff
changeset
|
156 |
] |
6b977f472cda
care for block-stores into outer contexts
Claus Gittinger <cg@exept.de>
parents:
148
diff
changeset
|
157 |
] |
6b977f472cda
care for block-stores into outer contexts
Claus Gittinger <cg@exept.de>
parents:
148
diff
changeset
|
158 |
] |
6b977f472cda
care for block-stores into outer contexts
Claus Gittinger <cg@exept.de>
parents:
148
diff
changeset
|
159 |
] |
6b977f472cda
care for block-stores into outer contexts
Claus Gittinger <cg@exept.de>
parents:
148
diff
changeset
|
160 |
] |
0 | 161 |
]. |
117 | 162 |
^ false |
219
6b977f472cda
care for block-stores into outer contexts
Claus Gittinger <cg@exept.de>
parents:
148
diff
changeset
|
163 |
|
6b977f472cda
care for block-stores into outer contexts
Claus Gittinger <cg@exept.de>
parents:
148
diff
changeset
|
164 |
"Modified: 1.3.1996 / 00:08:02 / cg" |
117 | 165 |
! |
166 |
||
167 |
codeForSideEffectOn:aStream inBlock:b for:aCompiler |
|
168 |
(self checkIncDecOn:aStream) ifTrue:[^ self]. |
|
219
6b977f472cda
care for block-stores into outer contexts
Claus Gittinger <cg@exept.de>
parents:
148
diff
changeset
|
169 |
|
6b977f472cda
care for block-stores into outer contexts
Claus Gittinger <cg@exept.de>
parents:
148
diff
changeset
|
170 |
self codeNormalOn:aStream valueNeeded:false inBlock:b for:aCompiler |
117 | 171 |
|
172 |
"Modified: 4.9.1995 / 14:38:10 / claus" |
|
219
6b977f472cda
care for block-stores into outer contexts
Claus Gittinger <cg@exept.de>
parents:
148
diff
changeset
|
173 |
"Modified: 1.3.1996 / 00:42:10 / cg" |
6b977f472cda
care for block-stores into outer contexts
Claus Gittinger <cg@exept.de>
parents:
148
diff
changeset
|
174 |
! |
6b977f472cda
care for block-stores into outer contexts
Claus Gittinger <cg@exept.de>
parents:
148
diff
changeset
|
175 |
|
6b977f472cda
care for block-stores into outer contexts
Claus Gittinger <cg@exept.de>
parents:
148
diff
changeset
|
176 |
codeNormalOn:aStream valueNeeded:forValue inBlock:b for:aCompiler |
871
ada5288239e4
support for workspace variables
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
177 |
|isSend litIdx selLitIdx| |
386 | 178 |
|
179 |
isSend := expression isMessage. |
|
180 |
(lineNr notNil |
|
181 |
and:[isSend not]) ifTrue:[ |
|
817 | 182 |
self codeLineNumber:lineNr on:aStream for:aCompiler |
386 | 183 |
]. |
184 |
||
871
ada5288239e4
support for workspace variables
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
185 |
"/ must do workspace variables here, because these |
ada5288239e4
support for workspace variables
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
186 |
"/ need the receiver (the valueHolder) to be pushed first, |
ada5288239e4
support for workspace variables
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
187 |
"/ then the value which is to be stored. |
ada5288239e4
support for workspace variables
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
188 |
"/ finally, a #value: message is generated. |
ada5288239e4
support for workspace variables
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
189 |
|
ada5288239e4
support for workspace variables
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
190 |
(variable type == #WorkspaceVariable) ifTrue:[ |
ada5288239e4
support for workspace variables
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
191 |
"/ this is done by keeping the valueHolder in the literalArray, |
ada5288239e4
support for workspace variables
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
192 |
"/ and coding a #value: message here. |
ada5288239e4
support for workspace variables
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
193 |
|
876 | 194 |
litIdx := aCompiler addLiteral:variable token. |
1806
0aeedab88cac
some code savers for common code-emit;
Claus Gittinger <cg@exept.de>
parents:
1589
diff
changeset
|
195 |
self emitPushLiteralIndex:litIdx on:aStream for:aCompiler. |
0aeedab88cac
some code savers for common code-emit;
Claus Gittinger <cg@exept.de>
parents:
1589
diff
changeset
|
196 |
|
871
ada5288239e4
support for workspace variables
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
197 |
expression codeOn:aStream inBlock:b for:aCompiler. |
ada5288239e4
support for workspace variables
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
198 |
|
ada5288239e4
support for workspace variables
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
199 |
selLitIdx := aCompiler addLiteral:#value:. |
1806
0aeedab88cac
some code savers for common code-emit;
Claus Gittinger <cg@exept.de>
parents:
1589
diff
changeset
|
200 |
self emitSendLiteralIndex:selLitIdx numArgs:1 line:(lineNr ? 1) on:aStream. |
1046 | 201 |
aStream nextPut:#drop. |
871
ada5288239e4
support for workspace variables
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
202 |
|
ada5288239e4
support for workspace variables
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
203 |
forValue ifTrue:[ |
ada5288239e4
support for workspace variables
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
204 |
(expression isConstant or:[expression isVariable]) ifTrue:[ |
ada5288239e4
support for workspace variables
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
205 |
expression codeOn:aStream inBlock:b for:aCompiler. |
ada5288239e4
support for workspace variables
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
206 |
] ifFalse:[ |
ada5288239e4
support for workspace variables
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
207 |
"/ fetch value from the holder - sigh |
1806
0aeedab88cac
some code savers for common code-emit;
Claus Gittinger <cg@exept.de>
parents:
1589
diff
changeset
|
208 |
self emitPushLiteralIndex:litIdx on:aStream for:aCompiler. |
871
ada5288239e4
support for workspace variables
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
209 |
|
ada5288239e4
support for workspace variables
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
210 |
selLitIdx := aCompiler addLiteral:#value. |
1806
0aeedab88cac
some code savers for common code-emit;
Claus Gittinger <cg@exept.de>
parents:
1589
diff
changeset
|
211 |
self emitSendLiteralIndex:selLitIdx numArgs:0 line:(lineNr ? 1) on:aStream. |
871
ada5288239e4
support for workspace variables
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
212 |
] |
ada5288239e4
support for workspace variables
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
213 |
]. |
ada5288239e4
support for workspace variables
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
214 |
^ self |
ada5288239e4
support for workspace variables
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
215 |
]. |
ada5288239e4
support for workspace variables
Claus Gittinger <cg@exept.de>
parents:
817
diff
changeset
|
216 |
|
219
6b977f472cda
care for block-stores into outer contexts
Claus Gittinger <cg@exept.de>
parents:
148
diff
changeset
|
217 |
expression codeOn:aStream inBlock:b for:aCompiler. |
6b977f472cda
care for block-stores into outer contexts
Claus Gittinger <cg@exept.de>
parents:
148
diff
changeset
|
218 |
expression isBlock ifTrue:[ |
6b977f472cda
care for block-stores into outer contexts
Claus Gittinger <cg@exept.de>
parents:
148
diff
changeset
|
219 |
variable isLocal ifTrue:[ |
6b977f472cda
care for block-stores into outer contexts
Claus Gittinger <cg@exept.de>
parents:
148
diff
changeset
|
220 |
aStream nextPut:#blockRef |
6b977f472cda
care for block-stores into outer contexts
Claus Gittinger <cg@exept.de>
parents:
148
diff
changeset
|
221 |
] |
6b977f472cda
care for block-stores into outer contexts
Claus Gittinger <cg@exept.de>
parents:
148
diff
changeset
|
222 |
]. |
6b977f472cda
care for block-stores into outer contexts
Claus Gittinger <cg@exept.de>
parents:
148
diff
changeset
|
223 |
|
386 | 224 |
(lineNr notNil |
225 |
and:[isSend]) ifTrue:[ |
|
817 | 226 |
self codeLineNumber:lineNr on:aStream for:aCompiler |
375 | 227 |
]. |
219
6b977f472cda
care for block-stores into outer contexts
Claus Gittinger <cg@exept.de>
parents:
148
diff
changeset
|
228 |
variable codeStoreOn:aStream inBlock:b valueNeeded:forValue for:aCompiler |
6b977f472cda
care for block-stores into outer contexts
Claus Gittinger <cg@exept.de>
parents:
148
diff
changeset
|
229 |
|
6b977f472cda
care for block-stores into outer contexts
Claus Gittinger <cg@exept.de>
parents:
148
diff
changeset
|
230 |
"Modified: 4.9.1995 / 14:38:10 / claus" |
6b977f472cda
care for block-stores into outer contexts
Claus Gittinger <cg@exept.de>
parents:
148
diff
changeset
|
231 |
"Created: 1.3.1996 / 00:41:43 / cg" |
386 | 232 |
"Modified: 21.10.1996 / 16:26:33 / cg" |
0 | 233 |
! |
234 |
||
104 | 235 |
codeOn:aStream inBlock:b for:aCompiler |
117 | 236 |
(self checkIncDecOn:aStream) ifTrue:[ |
219
6b977f472cda
care for block-stores into outer contexts
Claus Gittinger <cg@exept.de>
parents:
148
diff
changeset
|
237 |
expression receiver codeOn:aStream inBlock:b for:aCompiler. |
6b977f472cda
care for block-stores into outer contexts
Claus Gittinger <cg@exept.de>
parents:
148
diff
changeset
|
238 |
^ self |
117 | 239 |
]. |
219
6b977f472cda
care for block-stores into outer contexts
Claus Gittinger <cg@exept.de>
parents:
148
diff
changeset
|
240 |
|
6b977f472cda
care for block-stores into outer contexts
Claus Gittinger <cg@exept.de>
parents:
148
diff
changeset
|
241 |
self codeNormalOn:aStream valueNeeded:true inBlock:b for:aCompiler |
6b977f472cda
care for block-stores into outer contexts
Claus Gittinger <cg@exept.de>
parents:
148
diff
changeset
|
242 |
|
6b977f472cda
care for block-stores into outer contexts
Claus Gittinger <cg@exept.de>
parents:
148
diff
changeset
|
243 |
"Modified: 1.3.1996 / 00:42:21 / cg" |
0 | 244 |
! ! |
245 |
||
1035 | 246 |
!AssignmentNode methodsFor:'enumerating'! |
539
69a1cd05c7d6
added node-walk facility (ST80 compatibility)
Claus Gittinger <cg@exept.de>
parents:
479
diff
changeset
|
247 |
|
69a1cd05c7d6
added node-walk facility (ST80 compatibility)
Claus Gittinger <cg@exept.de>
parents:
479
diff
changeset
|
248 |
nodeDo:anEnumerator |
69a1cd05c7d6
added node-walk facility (ST80 compatibility)
Claus Gittinger <cg@exept.de>
parents:
479
diff
changeset
|
249 |
"helper for parse tree walking" |
69a1cd05c7d6
added node-walk facility (ST80 compatibility)
Claus Gittinger <cg@exept.de>
parents:
479
diff
changeset
|
250 |
|
69a1cd05c7d6
added node-walk facility (ST80 compatibility)
Claus Gittinger <cg@exept.de>
parents:
479
diff
changeset
|
251 |
^ anEnumerator doAssignment:self variable:variable value:expression |
69a1cd05c7d6
added node-walk facility (ST80 compatibility)
Claus Gittinger <cg@exept.de>
parents:
479
diff
changeset
|
252 |
|
69a1cd05c7d6
added node-walk facility (ST80 compatibility)
Claus Gittinger <cg@exept.de>
parents:
479
diff
changeset
|
253 |
"Modified: 19.6.1997 / 16:37:50 / cg" |
69a1cd05c7d6
added node-walk facility (ST80 compatibility)
Claus Gittinger <cg@exept.de>
parents:
479
diff
changeset
|
254 |
! ! |
69a1cd05c7d6
added node-walk facility (ST80 compatibility)
Claus Gittinger <cg@exept.de>
parents:
479
diff
changeset
|
255 |
|
1035 | 256 |
!AssignmentNode methodsFor:'evaluation'! |
140 | 257 |
|
1384 | 258 |
evaluateIn:anEnvironment |
140 | 259 |
|value| |
1384 | 260 |
|
261 |
value := expression evaluateIn:anEnvironment. |
|
140 | 262 |
variable store:value. |
263 |
^ value |
|
264 |
! ! |
|
265 |
||
1079 | 266 |
!AssignmentNode methodsFor:'printing & storing'! |
0 | 267 |
|
268 |
printOn:aStream indent:i |
|
269 |
variable printOn:aStream. |
|
1173 | 270 |
self printOperatorOn:aStream. |
271 |
expression printOn:aStream |
|
272 |
! |
|
273 |
||
274 |
printOperatorOn:aStream |
|
0 | 275 |
aStream nextPutAll:' := '. |
276 |
! ! |
|
140 | 277 |
|
278 |
!AssignmentNode methodsFor:'queries'! |
|
279 |
||
479 | 280 |
collectBlocksInto:aCollection |
281 |
expression collectBlocksInto:aCollection. |
|
282 |
||
283 |
"Created: 11.1.1997 / 20:54:30 / cg" |
|
284 |
! |
|
285 |
||
2267 | 286 |
evaluatesToConstant |
287 |
"return true, if this is a node for an assignment" |
|
288 |
||
289 |
^ expression evaluatesToConstant |
|
290 |
! |
|
291 |
||
1589 | 292 |
precedence |
293 |
^ 0 |
|
294 |
||
295 |
"Created: / 20-04-2005 / 14:11:09 / cg" |
|
2267 | 296 |
! |
297 |
||
298 |
withConstantValueDo:aBlock |
|
299 |
"return true, if this evaluates to a constant value |
|
300 |
and evaluate aBlock with it" |
|
301 |
||
302 |
^ expression withConstantValueDo:aBlock |
|
140 | 303 |
! ! |
304 |
||
2318 | 305 |
!AssignmentNode methodsFor:'testing'! |
306 |
||
307 |
isAssignment |
|
308 |
"return true, if this is a node for an assignment" |
|
309 |
||
310 |
^ true |
|
311 |
! ! |
|
312 |
||
148 | 313 |
!AssignmentNode class methodsFor:'documentation'! |
314 |
||
2509 | 315 |
version_CVS |
316 |
^ '$Header: /cvs/stx/stx/libcomp/AssignmentNode.st,v 1.41 2011-06-28 20:17:34 vrany Exp $' |
|
2267 | 317 |
! |
318 |
||
2509 | 319 |
version_SVN |
320 |
^ ' Id ' |
|
148 | 321 |
! ! |