4236
|
1 |
"{ Encoding: utf8 }"
|
|
2 |
|
0
|
3 |
"
|
4
|
4 |
COPYRIGHT (c) 1989 by Claus Gittinger
|
104
|
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 |
"
|
1080
|
14 |
"{ Package: 'stx:libcomp' }"
|
|
15 |
|
3623
|
16 |
"{ NameSpace: Smalltalk }"
|
|
17 |
|
0
|
18 |
ParseNode subclass:#PrimaryNode
|
2504
|
19 |
instanceVariableNames:'value line charIndex'
|
261
|
20 |
classVariableNames:''
|
|
21 |
poolDictionaries:''
|
|
22 |
category:'System-Compiler-Support'
|
0
|
23 |
!
|
|
24 |
|
20
|
25 |
!PrimaryNode class methodsFor:'documentation'!
|
|
26 |
|
|
27 |
copyright
|
|
28 |
"
|
|
29 |
COPYRIGHT (c) 1989 by Claus Gittinger
|
104
|
30 |
All Rights Reserved
|
20
|
31 |
|
|
32 |
This software is furnished under a license and may be used
|
|
33 |
only in accordance with the terms of that license and with the
|
|
34 |
inclusion of the above copyright notice. This software may not
|
|
35 |
be provided or otherwise made available to, or used by, any
|
|
36 |
other person. No title to or ownership of the software is
|
|
37 |
hereby transferred.
|
|
38 |
"
|
|
39 |
!
|
|
40 |
|
|
41 |
documentation
|
|
42 |
"
|
|
43 |
node for parse-trees, representing primaries (variables & literals)
|
261
|
44 |
This is a helper class for the compiler.
|
263
|
45 |
|
|
46 |
[author:]
|
|
47 |
Claus Gittinger
|
20
|
48 |
"
|
|
49 |
! !
|
0
|
50 |
|
|
51 |
!PrimaryNode methodsFor:'accessing'!
|
|
52 |
|
2504
|
53 |
charIndex
|
|
54 |
^ charIndex
|
|
55 |
!
|
|
56 |
|
|
57 |
charIndex:something
|
|
58 |
charIndex := something.
|
|
59 |
!
|
|
60 |
|
|
61 |
line
|
|
62 |
^ line
|
|
63 |
!
|
|
64 |
|
|
65 |
line:something
|
|
66 |
line := something.
|
|
67 |
!
|
|
68 |
|
1786
|
69 |
type:t value:val
|
|
70 |
type := t.
|
|
71 |
value := val
|
|
72 |
!
|
|
73 |
|
0
|
74 |
value
|
|
75 |
^ value
|
1786
|
76 |
!
|
|
77 |
|
|
78 |
value:val
|
|
79 |
value := val
|
0
|
80 |
! !
|
|
81 |
|
|
82 |
!PrimaryNode methodsFor:'code generation'!
|
|
83 |
|
104
|
84 |
codeForSideEffectOn:aStream inBlock:b for:aCompiler
|
0
|
85 |
"no code at all"
|
|
86 |
^ self
|
|
87 |
!
|
|
88 |
|
104
|
89 |
codeStoreOn:aStream inBlock:codeBlock valueNeeded:valueNeeded for:aCompiler
|
19
|
90 |
^ self subclassResponsibility
|
0
|
91 |
! !
|
|
92 |
|
4236
|
93 |
!PrimaryNode methodsFor:'enumeration'!
|
|
94 |
|
|
95 |
allSubNodesDo:aBlock
|
|
96 |
"no subnodes"
|
|
97 |
|
|
98 |
^ self
|
|
99 |
! !
|
3623
|
100 |
|
1035
|
101 |
!PrimaryNode methodsFor:'evaluation'!
|
140
|
102 |
|
|
103 |
store:aValue
|
|
104 |
^ self subclassResponsibility
|
|
105 |
! !
|
|
106 |
|
1080
|
107 |
!PrimaryNode methodsFor:'printing & storing'!
|
0
|
108 |
|
|
109 |
printOn:aStream indent:i
|
19
|
110 |
^ self subclassResponsibility
|
0
|
111 |
! !
|
140
|
112 |
|
|
113 |
!PrimaryNode methodsFor:'queries'!
|
|
114 |
|
2317
|
115 |
precedence
|
|
116 |
^ 200
|
|
117 |
|
|
118 |
"Created: / 20-04-2005 / 14:12:04 / cg"
|
|
119 |
! !
|
|
120 |
|
|
121 |
!PrimaryNode methodsFor:'testing'!
|
|
122 |
|
1586
|
123 |
isArgument
|
|
124 |
^ false
|
|
125 |
!
|
|
126 |
|
3623
|
127 |
isBlockArg
|
|
128 |
"return false here; to be redefined in subclass(es)"
|
|
129 |
|
|
130 |
^ false
|
|
131 |
!
|
|
132 |
|
|
133 |
isBlockVariable
|
|
134 |
"return false here; to be redefined in subclass(es)"
|
|
135 |
|
|
136 |
^ false
|
|
137 |
!
|
|
138 |
|
1586
|
139 |
isClassVariable
|
|
140 |
^ false
|
|
141 |
!
|
|
142 |
|
|
143 |
isInstanceVariable
|
|
144 |
^ false
|
|
145 |
!
|
|
146 |
|
3852
|
147 |
isInstanceVariableNamed:name
|
|
148 |
^ false
|
|
149 |
!
|
|
150 |
|
1586
|
151 |
isLocal
|
|
152 |
^ false
|
|
153 |
!
|
|
154 |
|
|
155 |
isMethodArg
|
|
156 |
^ false
|
|
157 |
!
|
|
158 |
|
3623
|
159 |
isPoolVariable
|
|
160 |
"return false here; to be redefined in subclass(es)"
|
|
161 |
|
|
162 |
^ false
|
|
163 |
!
|
|
164 |
|
140
|
165 |
isPrimary
|
|
166 |
"return true, if this is a node for a primary (i.e. non-send)"
|
|
167 |
|
|
168 |
^ true
|
1586
|
169 |
!
|
|
170 |
|
|
171 |
isUndeclared
|
|
172 |
^ false
|
140
|
173 |
! !
|
|
174 |
|
148
|
175 |
!PrimaryNode class methodsFor:'documentation'!
|
|
176 |
|
2504
|
177 |
version_CVS
|
3852
|
178 |
^ '$Header$'
|
2317
|
179 |
!
|
|
180 |
|
2504
|
181 |
version_SVN
|
3623
|
182 |
^ '$ Id $'
|
148
|
183 |
! !
|
3623
|
184 |
|