SuperNode.st
author Claus Gittinger <cg@exept.de>
Wed, 20 Jul 2011 17:56:29 +0200
changeset 2570 f0b8fc6cdabb
parent 2326 5622ba16c448
child 2605 e40af6e65d7c
permissions -rw-r--r--
change info
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
"
1080
bd3f19f6009a category change
Claus Gittinger <cg@exept.de>
parents: 745
diff changeset
    12
"{ Package: 'stx:libcomp' }"
bd3f19f6009a category change
Claus Gittinger <cg@exept.de>
parents: 745
diff changeset
    13
14
f08ffd9958a5 Initial revision
claus
parents:
diff changeset
    14
SelfNode subclass:#SuperNode
261
0372e948ca2d commentary
Claus Gittinger <cg@exept.de>
parents: 148
diff changeset
    15
	instanceVariableNames:'class isHere'
0372e948ca2d commentary
Claus Gittinger <cg@exept.de>
parents: 148
diff changeset
    16
	classVariableNames:''
0372e948ca2d commentary
Claus Gittinger <cg@exept.de>
parents: 148
diff changeset
    17
	poolDictionaries:''
0372e948ca2d commentary
Claus Gittinger <cg@exept.de>
parents: 148
diff changeset
    18
	category:'System-Compiler-Support'
14
f08ffd9958a5 Initial revision
claus
parents:
diff changeset
    19
!
f08ffd9958a5 Initial revision
claus
parents:
diff changeset
    20
20
f8dd8ba75205 *** empty log message ***
claus
parents: 14
diff changeset
    21
!SuperNode class methodsFor:'documentation'!
f8dd8ba75205 *** empty log message ***
claus
parents: 14
diff changeset
    22
f8dd8ba75205 *** empty log message ***
claus
parents: 14
diff changeset
    23
copyright
f8dd8ba75205 *** empty log message ***
claus
parents: 14
diff changeset
    24
"
f8dd8ba75205 *** empty log message ***
claus
parents: 14
diff changeset
    25
 COPYRIGHT (c) 1994 by Claus Gittinger
49
02660b790c3e *** empty log message ***
claus
parents: 33
diff changeset
    26
	      All Rights Reserved
20
f8dd8ba75205 *** empty log message ***
claus
parents: 14
diff changeset
    27
f8dd8ba75205 *** empty log message ***
claus
parents: 14
diff changeset
    28
 This software is furnished under a license and may be used
f8dd8ba75205 *** empty log message ***
claus
parents: 14
diff changeset
    29
 only in accordance with the terms of that license and with the
f8dd8ba75205 *** empty log message ***
claus
parents: 14
diff changeset
    30
 inclusion of the above copyright notice.   This software may not
f8dd8ba75205 *** empty log message ***
claus
parents: 14
diff changeset
    31
 be provided or otherwise made available to, or used by, any
f8dd8ba75205 *** empty log message ***
claus
parents: 14
diff changeset
    32
 other person.  No title to or ownership of the software is
f8dd8ba75205 *** empty log message ***
claus
parents: 14
diff changeset
    33
 hereby transferred.
f8dd8ba75205 *** empty log message ***
claus
parents: 14
diff changeset
    34
"
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
documentation
f8dd8ba75205 *** empty log message ***
claus
parents: 14
diff changeset
    38
"
f8dd8ba75205 *** empty log message ***
claus
parents: 14
diff changeset
    39
    node for parse-trees, representing super
261
0372e948ca2d commentary
Claus Gittinger <cg@exept.de>
parents: 148
diff changeset
    40
    This is a helper class for the compiler.
263
3b21d0991eff documentation
Claus Gittinger <cg@exept.de>
parents: 261
diff changeset
    41
3b21d0991eff documentation
Claus Gittinger <cg@exept.de>
parents: 261
diff changeset
    42
    [author:]
3b21d0991eff documentation
Claus Gittinger <cg@exept.de>
parents: 261
diff changeset
    43
        Claus Gittinger
20
f8dd8ba75205 *** empty log message ***
claus
parents: 14
diff changeset
    44
"
f8dd8ba75205 *** empty log message ***
claus
parents: 14
diff changeset
    45
! !
14
f08ffd9958a5 Initial revision
claus
parents:
diff changeset
    46
f08ffd9958a5 Initial revision
claus
parents:
diff changeset
    47
!SuperNode class methodsFor:'instance creation'!
f08ffd9958a5 Initial revision
claus
parents:
diff changeset
    48
f08ffd9958a5 Initial revision
claus
parents:
diff changeset
    49
value:val inClass:cls 
49
02660b790c3e *** empty log message ***
claus
parents: 33
diff changeset
    50
    ^ (self basicNew) value:val inClass:cls here:false
02660b790c3e *** empty log message ***
claus
parents: 33
diff changeset
    51
!
02660b790c3e *** empty log message ***
claus
parents: 33
diff changeset
    52
02660b790c3e *** empty log message ***
claus
parents: 33
diff changeset
    53
value:val inClass:cls here:isHere
02660b790c3e *** empty log message ***
claus
parents: 33
diff changeset
    54
    ^ (self basicNew) value:val inClass:cls here:isHere
14
f08ffd9958a5 Initial revision
claus
parents:
diff changeset
    55
! !
f08ffd9958a5 Initial revision
claus
parents:
diff changeset
    56
f08ffd9958a5 Initial revision
claus
parents:
diff changeset
    57
!SuperNode methodsFor:'accessing'!
f08ffd9958a5 Initial revision
claus
parents:
diff changeset
    58
140
1ef1d1395146 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 135
diff changeset
    59
definingClass
1ef1d1395146 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 135
diff changeset
    60
    ^ class
1ef1d1395146 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 135
diff changeset
    61
!
1ef1d1395146 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 135
diff changeset
    62
49
02660b790c3e *** empty log message ***
claus
parents: 33
diff changeset
    63
value:val inClass:cls here:h
14
f08ffd9958a5 Initial revision
claus
parents:
diff changeset
    64
    type := #Super.
f08ffd9958a5 Initial revision
claus
parents:
diff changeset
    65
    value := val.
49
02660b790c3e *** empty log message ***
claus
parents: 33
diff changeset
    66
    class := cls.
02660b790c3e *** empty log message ***
claus
parents: 33
diff changeset
    67
    isHere := h
14
f08ffd9958a5 Initial revision
claus
parents:
diff changeset
    68
! !
f08ffd9958a5 Initial revision
claus
parents:
diff changeset
    69
1080
bd3f19f6009a category change
Claus Gittinger <cg@exept.de>
parents: 745
diff changeset
    70
!SuperNode methodsFor:'printing & storing'!
14
f08ffd9958a5 Initial revision
claus
parents:
diff changeset
    71
745
9d676236404d display string
Claus Gittinger <cg@exept.de>
parents: 263
diff changeset
    72
displayString
9d676236404d display string
Claus Gittinger <cg@exept.de>
parents: 263
diff changeset
    73
    "return a string for display in inspectors etc."
9d676236404d display string
Claus Gittinger <cg@exept.de>
parents: 263
diff changeset
    74
    isHere ifTrue:[
9d676236404d display string
Claus Gittinger <cg@exept.de>
parents: 263
diff changeset
    75
        ^ 'InterpreterVariable(here)'
9d676236404d display string
Claus Gittinger <cg@exept.de>
parents: 263
diff changeset
    76
    ] ifFalse:[
9d676236404d display string
Claus Gittinger <cg@exept.de>
parents: 263
diff changeset
    77
        ^ 'InterpreterVariable(super)'
9d676236404d display string
Claus Gittinger <cg@exept.de>
parents: 263
diff changeset
    78
    ]
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
    "Created: / 16.7.1998 / 19:57:59 / cg"
9d676236404d display string
Claus Gittinger <cg@exept.de>
parents: 263
diff changeset
    81
    "Modified: / 16.7.1998 / 19:58:45 / cg"
9d676236404d display string
Claus Gittinger <cg@exept.de>
parents: 263
diff changeset
    82
!
9d676236404d display string
Claus Gittinger <cg@exept.de>
parents: 263
diff changeset
    83
14
f08ffd9958a5 Initial revision
claus
parents:
diff changeset
    84
printOn:aStream indent:i
49
02660b790c3e *** empty log message ***
claus
parents: 33
diff changeset
    85
    isHere ifTrue:[
02660b790c3e *** empty log message ***
claus
parents: 33
diff changeset
    86
	aStream nextPutAll:'here'
02660b790c3e *** empty log message ***
claus
parents: 33
diff changeset
    87
    ] ifFalse:[
02660b790c3e *** empty log message ***
claus
parents: 33
diff changeset
    88
	aStream nextPutAll:'super'
02660b790c3e *** empty log message ***
claus
parents: 33
diff changeset
    89
    ]
14
f08ffd9958a5 Initial revision
claus
parents:
diff changeset
    90
! !
140
1ef1d1395146 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 135
diff changeset
    91
2326
5622ba16c448 category change
Claus Gittinger <cg@exept.de>
parents: 1080
diff changeset
    92
!SuperNode methodsFor:'testing'!
140
1ef1d1395146 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 135
diff changeset
    93
1ef1d1395146 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 135
diff changeset
    94
isHere
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
!
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
isSuper
1ef1d1395146 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 135
diff changeset
    99
    "return true, if this is a super-node"
1ef1d1395146 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 135
diff changeset
   100
1ef1d1395146 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 135
diff changeset
   101
    ^ true
1ef1d1395146 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 135
diff changeset
   102
! !
1ef1d1395146 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 135
diff changeset
   103
148
ef0e604209ec version method at the end
Claus Gittinger <cg@exept.de>
parents: 140
diff changeset
   104
!SuperNode class methodsFor:'documentation'!
ef0e604209ec version method at the end
Claus Gittinger <cg@exept.de>
parents: 140
diff changeset
   105
ef0e604209ec version method at the end
Claus Gittinger <cg@exept.de>
parents: 140
diff changeset
   106
version
2326
5622ba16c448 category change
Claus Gittinger <cg@exept.de>
parents: 1080
diff changeset
   107
    ^ '$Header: /cvs/stx/stx/libcomp/SuperNode.st,v 1.14 2010-01-18 16:01:33 cg Exp $'
5622ba16c448 category change
Claus Gittinger <cg@exept.de>
parents: 1080
diff changeset
   108
!
5622ba16c448 category change
Claus Gittinger <cg@exept.de>
parents: 1080
diff changeset
   109
5622ba16c448 category change
Claus Gittinger <cg@exept.de>
parents: 1080
diff changeset
   110
version_CVS
5622ba16c448 category change
Claus Gittinger <cg@exept.de>
parents: 1080
diff changeset
   111
    ^ '$Header: /cvs/stx/stx/libcomp/SuperNode.st,v 1.14 2010-01-18 16:01:33 cg Exp $'
148
ef0e604209ec version method at the end
Claus Gittinger <cg@exept.de>
parents: 140
diff changeset
   112
! !