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