SuperNode.st
author Claus Gittinger <cg@exept.de>
Sun, 02 Feb 2003 16:52:47 +0100
changeset 1366 f91f6a0a56d5
parent 1080 bd3f19f6009a
child 2326 5622ba16c448
permissions -rw-r--r--
when required to compile, use Compiler instead of self class.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
14
f08ffd9958a5 Initial revision
claus
parents:
diff changeset
     1
"
f08ffd9958a5 Initial revision
claus
parents:
diff changeset
     2
 COPYRIGHT (c) 1994 by Claus Gittinger
49
02660b790c3e *** empty log message ***
claus
parents: 33
diff changeset
     3
	      All Rights Reserved
14
f08ffd9958a5 Initial revision
claus
parents:
diff changeset
     4
f08ffd9958a5 Initial revision
claus
parents:
diff changeset
     5
 This software is furnished under a license and may be used
f08ffd9958a5 Initial revision
claus
parents:
diff changeset
     6
 only in accordance with the terms of that license and with the
f08ffd9958a5 Initial revision
claus
parents:
diff changeset
     7
 inclusion of the above copyright notice.   This software may not
f08ffd9958a5 Initial revision
claus
parents:
diff changeset
     8
 be provided or otherwise made available to, or used by, any
f08ffd9958a5 Initial revision
claus
parents:
diff changeset
     9
 other person.  No title to or ownership of the software is
f08ffd9958a5 Initial revision
claus
parents:
diff changeset
    10
 hereby transferred.
f08ffd9958a5 Initial revision
claus
parents:
diff changeset
    11
"
f08ffd9958a5 Initial revision
claus
parents:
diff changeset
    12
1080
bd3f19f6009a category change
Claus Gittinger <cg@exept.de>
parents: 745
diff changeset
    13
"{ Package: 'stx:libcomp' }"
bd3f19f6009a category change
Claus Gittinger <cg@exept.de>
parents: 745
diff changeset
    14
14
f08ffd9958a5 Initial revision
claus
parents:
diff changeset
    15
SelfNode subclass:#SuperNode
261
0372e948ca2d commentary
Claus Gittinger <cg@exept.de>
parents: 148
diff changeset
    16
	instanceVariableNames:'class isHere'
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'
14
f08ffd9958a5 Initial revision
claus
parents:
diff changeset
    20
!
f08ffd9958a5 Initial revision
claus
parents:
diff changeset
    21
20
f8dd8ba75205 *** empty log message ***
claus
parents: 14
diff changeset
    22
!SuperNode class methodsFor:'documentation'!
f8dd8ba75205 *** empty log message ***
claus
parents: 14
diff changeset
    23
f8dd8ba75205 *** empty log message ***
claus
parents: 14
diff changeset
    24
copyright
f8dd8ba75205 *** empty log message ***
claus
parents: 14
diff changeset
    25
"
f8dd8ba75205 *** empty log message ***
claus
parents: 14
diff changeset
    26
 COPYRIGHT (c) 1994 by Claus Gittinger
49
02660b790c3e *** empty log message ***
claus
parents: 33
diff changeset
    27
	      All Rights Reserved
20
f8dd8ba75205 *** empty log message ***
claus
parents: 14
diff changeset
    28
f8dd8ba75205 *** empty log message ***
claus
parents: 14
diff changeset
    29
 This software is furnished under a license and may be used
f8dd8ba75205 *** empty log message ***
claus
parents: 14
diff changeset
    30
 only in accordance with the terms of that license and with the
f8dd8ba75205 *** empty log message ***
claus
parents: 14
diff changeset
    31
 inclusion of the above copyright notice.   This software may not
f8dd8ba75205 *** empty log message ***
claus
parents: 14
diff changeset
    32
 be provided or otherwise made available to, or used by, any
f8dd8ba75205 *** empty log message ***
claus
parents: 14
diff changeset
    33
 other person.  No title to or ownership of the software is
f8dd8ba75205 *** empty log message ***
claus
parents: 14
diff changeset
    34
 hereby transferred.
f8dd8ba75205 *** empty log message ***
claus
parents: 14
diff changeset
    35
"
f8dd8ba75205 *** empty log message ***
claus
parents: 14
diff changeset
    36
!
f8dd8ba75205 *** empty log message ***
claus
parents: 14
diff changeset
    37
f8dd8ba75205 *** empty log message ***
claus
parents: 14
diff changeset
    38
documentation
f8dd8ba75205 *** empty log message ***
claus
parents: 14
diff changeset
    39
"
f8dd8ba75205 *** empty log message ***
claus
parents: 14
diff changeset
    40
    node for parse-trees, representing super
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: 14
diff changeset
    45
"
f8dd8ba75205 *** empty log message ***
claus
parents: 14
diff changeset
    46
! !
14
f08ffd9958a5 Initial revision
claus
parents:
diff changeset
    47
f08ffd9958a5 Initial revision
claus
parents:
diff changeset
    48
!SuperNode class methodsFor:'instance creation'!
f08ffd9958a5 Initial revision
claus
parents:
diff changeset
    49
f08ffd9958a5 Initial revision
claus
parents:
diff changeset
    50
value:val inClass:cls 
49
02660b790c3e *** empty log message ***
claus
parents: 33
diff changeset
    51
    ^ (self basicNew) value:val inClass:cls here:false
02660b790c3e *** empty log message ***
claus
parents: 33
diff changeset
    52
!
02660b790c3e *** empty log message ***
claus
parents: 33
diff changeset
    53
02660b790c3e *** empty log message ***
claus
parents: 33
diff changeset
    54
value:val inClass:cls here:isHere
02660b790c3e *** empty log message ***
claus
parents: 33
diff changeset
    55
    ^ (self basicNew) value:val inClass:cls here:isHere
14
f08ffd9958a5 Initial revision
claus
parents:
diff changeset
    56
! !
f08ffd9958a5 Initial revision
claus
parents:
diff changeset
    57
f08ffd9958a5 Initial revision
claus
parents:
diff changeset
    58
!SuperNode methodsFor:'accessing'!
f08ffd9958a5 Initial revision
claus
parents:
diff changeset
    59
140
1ef1d1395146 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 135
diff changeset
    60
definingClass
1ef1d1395146 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 135
diff changeset
    61
    ^ class
1ef1d1395146 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 135
diff changeset
    62
!
1ef1d1395146 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 135
diff changeset
    63
49
02660b790c3e *** empty log message ***
claus
parents: 33
diff changeset
    64
value:val inClass:cls here:h
14
f08ffd9958a5 Initial revision
claus
parents:
diff changeset
    65
    type := #Super.
f08ffd9958a5 Initial revision
claus
parents:
diff changeset
    66
    value := val.
49
02660b790c3e *** empty log message ***
claus
parents: 33
diff changeset
    67
    class := cls.
02660b790c3e *** empty log message ***
claus
parents: 33
diff changeset
    68
    isHere := h
14
f08ffd9958a5 Initial revision
claus
parents:
diff changeset
    69
! !
f08ffd9958a5 Initial revision
claus
parents:
diff changeset
    70
1080
bd3f19f6009a category change
Claus Gittinger <cg@exept.de>
parents: 745
diff changeset
    71
!SuperNode methodsFor:'printing & storing'!
14
f08ffd9958a5 Initial revision
claus
parents:
diff changeset
    72
745
9d676236404d display string
Claus Gittinger <cg@exept.de>
parents: 263
diff changeset
    73
displayString
9d676236404d display string
Claus Gittinger <cg@exept.de>
parents: 263
diff changeset
    74
    "return a string for display in inspectors etc."
9d676236404d display string
Claus Gittinger <cg@exept.de>
parents: 263
diff changeset
    75
    isHere ifTrue:[
9d676236404d display string
Claus Gittinger <cg@exept.de>
parents: 263
diff changeset
    76
        ^ 'InterpreterVariable(here)'
9d676236404d display string
Claus Gittinger <cg@exept.de>
parents: 263
diff changeset
    77
    ] ifFalse:[
9d676236404d display string
Claus Gittinger <cg@exept.de>
parents: 263
diff changeset
    78
        ^ 'InterpreterVariable(super)'
9d676236404d display string
Claus Gittinger <cg@exept.de>
parents: 263
diff changeset
    79
    ]
9d676236404d display string
Claus Gittinger <cg@exept.de>
parents: 263
diff changeset
    80
9d676236404d display string
Claus Gittinger <cg@exept.de>
parents: 263
diff changeset
    81
    "Created: / 16.7.1998 / 19:57:59 / cg"
9d676236404d display string
Claus Gittinger <cg@exept.de>
parents: 263
diff changeset
    82
    "Modified: / 16.7.1998 / 19:58:45 / cg"
9d676236404d display string
Claus Gittinger <cg@exept.de>
parents: 263
diff changeset
    83
!
9d676236404d display string
Claus Gittinger <cg@exept.de>
parents: 263
diff changeset
    84
14
f08ffd9958a5 Initial revision
claus
parents:
diff changeset
    85
printOn:aStream indent:i
49
02660b790c3e *** empty log message ***
claus
parents: 33
diff changeset
    86
    isHere ifTrue:[
02660b790c3e *** empty log message ***
claus
parents: 33
diff changeset
    87
	aStream nextPutAll:'here'
02660b790c3e *** empty log message ***
claus
parents: 33
diff changeset
    88
    ] ifFalse:[
02660b790c3e *** empty log message ***
claus
parents: 33
diff changeset
    89
	aStream nextPutAll:'super'
02660b790c3e *** empty log message ***
claus
parents: 33
diff changeset
    90
    ]
14
f08ffd9958a5 Initial revision
claus
parents:
diff changeset
    91
! !
140
1ef1d1395146 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 135
diff changeset
    92
1ef1d1395146 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 135
diff changeset
    93
!SuperNode methodsFor:'queries'!
1ef1d1395146 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 135
diff changeset
    94
1ef1d1395146 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 135
diff changeset
    95
isHere
1ef1d1395146 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 135
diff changeset
    96
    ^ isHere
1ef1d1395146 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 135
diff changeset
    97
!
1ef1d1395146 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 135
diff changeset
    98
1ef1d1395146 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 135
diff changeset
    99
isSuper
1ef1d1395146 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 135
diff changeset
   100
    "return true, if this is a super-node"
1ef1d1395146 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 135
diff changeset
   101
1ef1d1395146 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 135
diff changeset
   102
    ^ true
1ef1d1395146 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 135
diff changeset
   103
! !
1ef1d1395146 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 135
diff changeset
   104
148
ef0e604209ec version method at the end
Claus Gittinger <cg@exept.de>
parents: 140
diff changeset
   105
!SuperNode class methodsFor:'documentation'!
ef0e604209ec version method at the end
Claus Gittinger <cg@exept.de>
parents: 140
diff changeset
   106
ef0e604209ec version method at the end
Claus Gittinger <cg@exept.de>
parents: 140
diff changeset
   107
version
1080
bd3f19f6009a category change
Claus Gittinger <cg@exept.de>
parents: 745
diff changeset
   108
    ^ '$Header: /cvs/stx/stx/libcomp/SuperNode.st,v 1.13 2000-08-31 10:03:41 cg Exp $'
148
ef0e604209ec version method at the end
Claus Gittinger <cg@exept.de>
parents: 140
diff changeset
   109
! !