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