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 |
|
0
|
14 |
ParseNode subclass:#PrimaryNode
|
2504
|
15 |
instanceVariableNames:'value line charIndex'
|
261
|
16 |
classVariableNames:''
|
|
17 |
poolDictionaries:''
|
|
18 |
category:'System-Compiler-Support'
|
0
|
19 |
!
|
|
20 |
|
20
|
21 |
!PrimaryNode class methodsFor:'documentation'!
|
|
22 |
|
|
23 |
copyright
|
|
24 |
"
|
|
25 |
COPYRIGHT (c) 1989 by Claus Gittinger
|
104
|
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 |
"
|
|
39 |
node for parse-trees, representing primaries (variables & literals)
|
261
|
40 |
This is a helper class for the compiler.
|
263
|
41 |
|
|
42 |
[author:]
|
|
43 |
Claus Gittinger
|
20
|
44 |
"
|
|
45 |
! !
|
0
|
46 |
|
|
47 |
!PrimaryNode methodsFor:'accessing'!
|
|
48 |
|
2504
|
49 |
charIndex
|
|
50 |
^ charIndex
|
|
51 |
!
|
|
52 |
|
|
53 |
charIndex:something
|
|
54 |
charIndex := something.
|
|
55 |
!
|
|
56 |
|
|
57 |
line
|
|
58 |
^ line
|
|
59 |
!
|
|
60 |
|
|
61 |
line:something
|
|
62 |
line := something.
|
|
63 |
!
|
|
64 |
|
1786
|
65 |
type:t value:val
|
|
66 |
type := t.
|
|
67 |
value := val
|
|
68 |
!
|
|
69 |
|
0
|
70 |
value
|
|
71 |
^ value
|
1786
|
72 |
!
|
|
73 |
|
|
74 |
value:val
|
|
75 |
value := val
|
0
|
76 |
! !
|
|
77 |
|
|
78 |
!PrimaryNode methodsFor:'code generation'!
|
|
79 |
|
104
|
80 |
codeForSideEffectOn:aStream inBlock:b for:aCompiler
|
0
|
81 |
"no code at all"
|
|
82 |
^ self
|
|
83 |
!
|
|
84 |
|
104
|
85 |
codeStoreOn:aStream inBlock:codeBlock valueNeeded:valueNeeded for:aCompiler
|
19
|
86 |
^ self subclassResponsibility
|
0
|
87 |
! !
|
|
88 |
|
1035
|
89 |
!PrimaryNode methodsFor:'evaluation'!
|
140
|
90 |
|
|
91 |
store:aValue
|
|
92 |
^ self subclassResponsibility
|
|
93 |
! !
|
|
94 |
|
1080
|
95 |
!PrimaryNode methodsFor:'printing & storing'!
|
0
|
96 |
|
|
97 |
printOn:aStream indent:i
|
19
|
98 |
^ self subclassResponsibility
|
0
|
99 |
! !
|
140
|
100 |
|
|
101 |
!PrimaryNode methodsFor:'queries'!
|
|
102 |
|
2317
|
103 |
precedence
|
|
104 |
^ 200
|
|
105 |
|
|
106 |
"Created: / 20-04-2005 / 14:12:04 / cg"
|
|
107 |
! !
|
|
108 |
|
|
109 |
!PrimaryNode methodsFor:'testing'!
|
|
110 |
|
1586
|
111 |
isArgument
|
|
112 |
^ false
|
|
113 |
!
|
|
114 |
|
|
115 |
isClassVariable
|
|
116 |
^ false
|
|
117 |
!
|
|
118 |
|
|
119 |
isInstanceVariable
|
|
120 |
^ false
|
|
121 |
!
|
|
122 |
|
|
123 |
isLocal
|
|
124 |
^ false
|
|
125 |
!
|
|
126 |
|
|
127 |
isMethodArg
|
|
128 |
^ false
|
|
129 |
!
|
|
130 |
|
140
|
131 |
isPrimary
|
|
132 |
"return true, if this is a node for a primary (i.e. non-send)"
|
|
133 |
|
|
134 |
^ true
|
1586
|
135 |
!
|
|
136 |
|
|
137 |
isUndeclared
|
|
138 |
^ false
|
140
|
139 |
! !
|
|
140 |
|
148
|
141 |
!PrimaryNode class methodsFor:'documentation'!
|
|
142 |
|
2504
|
143 |
version_CVS
|
2586
|
144 |
^ '$Header: /cvs/stx/stx/libcomp/PrimaryNode.st,v 1.31 2011-07-25 21:52:50 vrany Exp $'
|
2317
|
145 |
!
|
|
146 |
|
2504
|
147 |
version_SVN
|
2586
|
148 |
^ '§ Id §'
|
148
|
149 |
! !
|