author | Claus Gittinger <cg@exept.de> |
Thu, 19 Jun 1997 18:38:52 +0200 | |
changeset 542 | 728300bd8861 |
parent 263 | 3b21d0991eff |
child 1035 | 8848672cb893 |
permissions | -rw-r--r-- |
0 | 1 |
" |
4 | 2 |
COPYRIGHT (c) 1989 by Claus Gittinger |
135
aa4f7b8f121e
uff - version methods changed to return stings
Claus Gittinger <cg@exept.de>
parents:
103
diff
changeset
|
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 |
" |
|
12 |
||
13 |
Object subclass:#Variable |
|
261 | 14 |
instanceVariableNames:'value name used' |
15 |
classVariableNames:'' |
|
16 |
poolDictionaries:'' |
|
17 |
category:'System-Compiler-Support' |
|
0 | 18 |
! |
19 |
||
20 | 20 |
!Variable class methodsFor:'documentation'! |
21 |
||
22 |
copyright |
|
23 |
" |
|
24 |
COPYRIGHT (c) 1989 by Claus Gittinger |
|
135
aa4f7b8f121e
uff - version methods changed to return stings
Claus Gittinger <cg@exept.de>
parents:
103
diff
changeset
|
25 |
All Rights Reserved |
20 | 26 |
|
27 |
This software is furnished under a license and may be used |
|
28 |
only in accordance with the terms of that license and with the |
|
29 |
inclusion of the above copyright notice. This software may not |
|
30 |
be provided or otherwise made available to, or used by, any |
|
31 |
other person. No title to or ownership of the software is |
|
32 |
hereby transferred. |
|
33 |
" |
|
34 |
! |
|
35 |
||
36 |
documentation |
|
37 |
" |
|
38 |
node for parse-trees, representing variables |
|
261 | 39 |
This is a helper class for the compiler. |
263 | 40 |
|
41 |
[author:] |
|
42 |
Claus Gittinger |
|
20 | 43 |
" |
44 |
! ! |
|
0 | 45 |
|
46 |
!Variable class methodsFor:'instance creation'! |
|
47 |
||
48 |
name:name |
|
11 | 49 |
"return a new node for a variable named name" |
0 | 50 |
^ (self new) name:name |
51 |
! ! |
|
52 |
||
53 |
!Variable methodsFor:'accessing'! |
|
54 |
||
140 | 55 |
name |
56 |
"return the name of the variable" |
|
11 | 57 |
|
140 | 58 |
^ name |
0 | 59 |
! |
60 |
||
61 |
name:aString |
|
11 | 62 |
"set the name of the variable" |
63 |
||
0 | 64 |
name := aString |
65 |
! |
|
66 |
||
140 | 67 |
used |
68 |
"return the flag marking that this variable has been used" |
|
11 | 69 |
|
140 | 70 |
^ used |
71 |
! |
|
72 |
||
73 |
used:aBoolean |
|
74 |
"set/clear the flag marking that this variable has been used" |
|
75 |
||
76 |
used := aBoolean |
|
0 | 77 |
! |
78 |
||
79 |
value |
|
11 | 80 |
"return the value of the variable" |
81 |
||
0 | 82 |
^ value |
83 |
! |
|
84 |
||
140 | 85 |
value:v |
86 |
"set the value of the (simulated) variable" |
|
87 |
||
88 |
value := v |
|
89 |
! |
|
90 |
||
31 | 91 |
variableValue |
92 |
"return the value of the variable" |
|
93 |
||
94 |
^ value |
|
140 | 95 |
! ! |
11 | 96 |
|
542 | 97 |
!Variable methodsFor:'enumeration'! |
98 |
||
99 |
nodeDo:anEnumerator |
|
100 |
"helper for parse tree walking" |
|
101 |
||
102 |
^ anEnumerator doVariable:self name:name |
|
103 |
||
104 |
"Created: 19.6.1997 / 17:11:48 / cg" |
|
105 |
! ! |
|
106 |
||
148 | 107 |
!Variable class methodsFor:'documentation'! |
108 |
||
109 |
version |
|
542 | 110 |
^ '$Header: /cvs/stx/stx/libcomp/Variable.st,v 1.14 1997-06-19 16:38:52 cg Exp $' |
148 | 111 |
! ! |