Variable.st
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--
more ST80 compatibility
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
0
7ad01559b262 Initial revision
claus
parents:
diff changeset
     1
"
4
f6fd83437415 *** empty log message ***
claus
parents: 3
diff changeset
     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
7ad01559b262 Initial revision
claus
parents:
diff changeset
     4
7ad01559b262 Initial revision
claus
parents:
diff changeset
     5
 This software is furnished under a license and may be used
7ad01559b262 Initial revision
claus
parents:
diff changeset
     6
 only in accordance with the terms of that license and with the
7ad01559b262 Initial revision
claus
parents:
diff changeset
     7
 inclusion of the above copyright notice.   This software may not
7ad01559b262 Initial revision
claus
parents:
diff changeset
     8
 be provided or otherwise made available to, or used by, any
7ad01559b262 Initial revision
claus
parents:
diff changeset
     9
 other person.  No title to or ownership of the software is
7ad01559b262 Initial revision
claus
parents:
diff changeset
    10
 hereby transferred.
7ad01559b262 Initial revision
claus
parents:
diff changeset
    11
"
7ad01559b262 Initial revision
claus
parents:
diff changeset
    12
7ad01559b262 Initial revision
claus
parents:
diff changeset
    13
Object subclass:#Variable
261
0372e948ca2d commentary
Claus Gittinger <cg@exept.de>
parents: 148
diff changeset
    14
	instanceVariableNames:'value name used'
0372e948ca2d commentary
Claus Gittinger <cg@exept.de>
parents: 148
diff changeset
    15
	classVariableNames:''
0372e948ca2d commentary
Claus Gittinger <cg@exept.de>
parents: 148
diff changeset
    16
	poolDictionaries:''
0372e948ca2d commentary
Claus Gittinger <cg@exept.de>
parents: 148
diff changeset
    17
	category:'System-Compiler-Support'
0
7ad01559b262 Initial revision
claus
parents:
diff changeset
    18
!
7ad01559b262 Initial revision
claus
parents:
diff changeset
    19
20
f8dd8ba75205 *** empty log message ***
claus
parents: 11
diff changeset
    20
!Variable class methodsFor:'documentation'!
f8dd8ba75205 *** empty log message ***
claus
parents: 11
diff changeset
    21
f8dd8ba75205 *** empty log message ***
claus
parents: 11
diff changeset
    22
copyright
f8dd8ba75205 *** empty log message ***
claus
parents: 11
diff changeset
    23
"
f8dd8ba75205 *** empty log message ***
claus
parents: 11
diff changeset
    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
f8dd8ba75205 *** empty log message ***
claus
parents: 11
diff changeset
    26
f8dd8ba75205 *** empty log message ***
claus
parents: 11
diff changeset
    27
 This software is furnished under a license and may be used
f8dd8ba75205 *** empty log message ***
claus
parents: 11
diff changeset
    28
 only in accordance with the terms of that license and with the
f8dd8ba75205 *** empty log message ***
claus
parents: 11
diff changeset
    29
 inclusion of the above copyright notice.   This software may not
f8dd8ba75205 *** empty log message ***
claus
parents: 11
diff changeset
    30
 be provided or otherwise made available to, or used by, any
f8dd8ba75205 *** empty log message ***
claus
parents: 11
diff changeset
    31
 other person.  No title to or ownership of the software is
f8dd8ba75205 *** empty log message ***
claus
parents: 11
diff changeset
    32
 hereby transferred.
f8dd8ba75205 *** empty log message ***
claus
parents: 11
diff changeset
    33
"
f8dd8ba75205 *** empty log message ***
claus
parents: 11
diff changeset
    34
!
f8dd8ba75205 *** empty log message ***
claus
parents: 11
diff changeset
    35
f8dd8ba75205 *** empty log message ***
claus
parents: 11
diff changeset
    36
documentation
f8dd8ba75205 *** empty log message ***
claus
parents: 11
diff changeset
    37
"
f8dd8ba75205 *** empty log message ***
claus
parents: 11
diff changeset
    38
    node for parse-trees, representing variables
261
0372e948ca2d commentary
Claus Gittinger <cg@exept.de>
parents: 148
diff changeset
    39
    This is a helper class for the compiler.
263
3b21d0991eff documentation
Claus Gittinger <cg@exept.de>
parents: 261
diff changeset
    40
3b21d0991eff documentation
Claus Gittinger <cg@exept.de>
parents: 261
diff changeset
    41
    [author:]
3b21d0991eff documentation
Claus Gittinger <cg@exept.de>
parents: 261
diff changeset
    42
        Claus Gittinger
20
f8dd8ba75205 *** empty log message ***
claus
parents: 11
diff changeset
    43
"
f8dd8ba75205 *** empty log message ***
claus
parents: 11
diff changeset
    44
! !
0
7ad01559b262 Initial revision
claus
parents:
diff changeset
    45
7ad01559b262 Initial revision
claus
parents:
diff changeset
    46
!Variable class methodsFor:'instance creation'!
7ad01559b262 Initial revision
claus
parents:
diff changeset
    47
7ad01559b262 Initial revision
claus
parents:
diff changeset
    48
name:name
11
60691e5007e3 *** empty log message ***
claus
parents: 4
diff changeset
    49
    "return a new node for a variable named name"
0
7ad01559b262 Initial revision
claus
parents:
diff changeset
    50
    ^ (self new) name:name
7ad01559b262 Initial revision
claus
parents:
diff changeset
    51
! !
7ad01559b262 Initial revision
claus
parents:
diff changeset
    52
7ad01559b262 Initial revision
claus
parents:
diff changeset
    53
!Variable methodsFor:'accessing'!
7ad01559b262 Initial revision
claus
parents:
diff changeset
    54
140
1ef1d1395146 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 135
diff changeset
    55
name
1ef1d1395146 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 135
diff changeset
    56
    "return the name of the variable"
11
60691e5007e3 *** empty log message ***
claus
parents: 4
diff changeset
    57
140
1ef1d1395146 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 135
diff changeset
    58
    ^ name
0
7ad01559b262 Initial revision
claus
parents:
diff changeset
    59
!
7ad01559b262 Initial revision
claus
parents:
diff changeset
    60
7ad01559b262 Initial revision
claus
parents:
diff changeset
    61
name:aString
11
60691e5007e3 *** empty log message ***
claus
parents: 4
diff changeset
    62
    "set the name of the variable"
60691e5007e3 *** empty log message ***
claus
parents: 4
diff changeset
    63
0
7ad01559b262 Initial revision
claus
parents:
diff changeset
    64
    name := aString
7ad01559b262 Initial revision
claus
parents:
diff changeset
    65
!
7ad01559b262 Initial revision
claus
parents:
diff changeset
    66
140
1ef1d1395146 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 135
diff changeset
    67
used
1ef1d1395146 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 135
diff changeset
    68
    "return the flag marking that this variable has been used"
11
60691e5007e3 *** empty log message ***
claus
parents: 4
diff changeset
    69
140
1ef1d1395146 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 135
diff changeset
    70
    ^ used
1ef1d1395146 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 135
diff changeset
    71
!
1ef1d1395146 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 135
diff changeset
    72
1ef1d1395146 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 135
diff changeset
    73
used:aBoolean
1ef1d1395146 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 135
diff changeset
    74
    "set/clear the flag marking that this variable has been used"
1ef1d1395146 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 135
diff changeset
    75
1ef1d1395146 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 135
diff changeset
    76
    used := aBoolean
0
7ad01559b262 Initial revision
claus
parents:
diff changeset
    77
!
7ad01559b262 Initial revision
claus
parents:
diff changeset
    78
7ad01559b262 Initial revision
claus
parents:
diff changeset
    79
value
11
60691e5007e3 *** empty log message ***
claus
parents: 4
diff changeset
    80
    "return the value of the variable"
60691e5007e3 *** empty log message ***
claus
parents: 4
diff changeset
    81
0
7ad01559b262 Initial revision
claus
parents:
diff changeset
    82
    ^ value
7ad01559b262 Initial revision
claus
parents:
diff changeset
    83
!
7ad01559b262 Initial revision
claus
parents:
diff changeset
    84
140
1ef1d1395146 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 135
diff changeset
    85
value:v
1ef1d1395146 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 135
diff changeset
    86
    "set the value of the (simulated) variable"
1ef1d1395146 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 135
diff changeset
    87
1ef1d1395146 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 135
diff changeset
    88
    value := v
1ef1d1395146 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 135
diff changeset
    89
!
1ef1d1395146 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 135
diff changeset
    90
31
6cd13c331fb0 *** empty log message ***
claus
parents: 20
diff changeset
    91
variableValue
6cd13c331fb0 *** empty log message ***
claus
parents: 20
diff changeset
    92
    "return the value of the variable"
6cd13c331fb0 *** empty log message ***
claus
parents: 20
diff changeset
    93
6cd13c331fb0 *** empty log message ***
claus
parents: 20
diff changeset
    94
    ^ value
140
1ef1d1395146 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 135
diff changeset
    95
! !
11
60691e5007e3 *** empty log message ***
claus
parents: 4
diff changeset
    96
542
728300bd8861 more ST80 compatibility
Claus Gittinger <cg@exept.de>
parents: 263
diff changeset
    97
!Variable methodsFor:'enumeration'!
728300bd8861 more ST80 compatibility
Claus Gittinger <cg@exept.de>
parents: 263
diff changeset
    98
728300bd8861 more ST80 compatibility
Claus Gittinger <cg@exept.de>
parents: 263
diff changeset
    99
nodeDo:anEnumerator
728300bd8861 more ST80 compatibility
Claus Gittinger <cg@exept.de>
parents: 263
diff changeset
   100
    "helper for parse tree walking"
728300bd8861 more ST80 compatibility
Claus Gittinger <cg@exept.de>
parents: 263
diff changeset
   101
728300bd8861 more ST80 compatibility
Claus Gittinger <cg@exept.de>
parents: 263
diff changeset
   102
    ^ anEnumerator doVariable:self name:name
728300bd8861 more ST80 compatibility
Claus Gittinger <cg@exept.de>
parents: 263
diff changeset
   103
728300bd8861 more ST80 compatibility
Claus Gittinger <cg@exept.de>
parents: 263
diff changeset
   104
    "Created: 19.6.1997 / 17:11:48 / cg"
728300bd8861 more ST80 compatibility
Claus Gittinger <cg@exept.de>
parents: 263
diff changeset
   105
! !
728300bd8861 more ST80 compatibility
Claus Gittinger <cg@exept.de>
parents: 263
diff changeset
   106
148
ef0e604209ec version method at the end
Claus Gittinger <cg@exept.de>
parents: 140
diff changeset
   107
!Variable class methodsFor:'documentation'!
ef0e604209ec version method at the end
Claus Gittinger <cg@exept.de>
parents: 140
diff changeset
   108
ef0e604209ec version method at the end
Claus Gittinger <cg@exept.de>
parents: 140
diff changeset
   109
version
542
728300bd8861 more ST80 compatibility
Claus Gittinger <cg@exept.de>
parents: 263
diff changeset
   110
    ^ '$Header: /cvs/stx/stx/libcomp/Variable.st,v 1.14 1997-06-19 16:38:52 cg Exp $'
148
ef0e604209ec version method at the end
Claus Gittinger <cg@exept.de>
parents: 140
diff changeset
   111
! !