author | Jan Vrany <jan.vrany@labware.com> |
Thu, 27 Oct 2022 14:53:59 +0100 | |
branch | jv |
changeset 4735 | 3b11fb3ede98 |
parent 4300 | cff050b708a1 |
permissions | -rw-r--r-- |
4300 | 1 |
"{ Encoding: utf8 }" |
2 |
||
14 | 3 |
" |
4 |
COPYRIGHT (c) 1994 by Claus Gittinger |
|
49 | 5 |
All Rights Reserved |
14 | 6 |
|
7 |
This software is furnished under a license and may be used |
|
8 |
only in accordance with the terms of that license and with the |
|
9 |
inclusion of the above copyright notice. This software may not |
|
10 |
be provided or otherwise made available to, or used by, any |
|
11 |
other person. No title to or ownership of the software is |
|
12 |
hereby transferred. |
|
13 |
" |
|
1080 | 14 |
"{ Package: 'stx:libcomp' }" |
15 |
||
4130 | 16 |
"{ NameSpace: Smalltalk }" |
17 |
||
14 | 18 |
SelfNode subclass:#SuperNode |
261 | 19 |
instanceVariableNames:'class isHere' |
20 |
classVariableNames:'' |
|
21 |
poolDictionaries:'' |
|
22 |
category:'System-Compiler-Support' |
|
14 | 23 |
! |
24 |
||
20 | 25 |
!SuperNode class methodsFor:'documentation'! |
26 |
||
27 |
copyright |
|
28 |
" |
|
29 |
COPYRIGHT (c) 1994 by Claus Gittinger |
|
49 | 30 |
All Rights Reserved |
20 | 31 |
|
32 |
This software is furnished under a license and may be used |
|
33 |
only in accordance with the terms of that license and with the |
|
34 |
inclusion of the above copyright notice. This software may not |
|
35 |
be provided or otherwise made available to, or used by, any |
|
36 |
other person. No title to or ownership of the software is |
|
37 |
hereby transferred. |
|
38 |
" |
|
39 |
! |
|
40 |
||
41 |
documentation |
|
42 |
" |
|
43 |
node for parse-trees, representing super |
|
261 | 44 |
This is a helper class for the compiler. |
263 | 45 |
|
46 |
[author:] |
|
47 |
Claus Gittinger |
|
20 | 48 |
" |
49 |
! ! |
|
14 | 50 |
|
51 |
!SuperNode class methodsFor:'instance creation'! |
|
52 |
||
53 |
value:val inClass:cls |
|
49 | 54 |
^ (self basicNew) value:val inClass:cls here:false |
55 |
! |
|
56 |
||
57 |
value:val inClass:cls here:isHere |
|
58 |
^ (self basicNew) value:val inClass:cls here:isHere |
|
14 | 59 |
! ! |
60 |
||
61 |
!SuperNode methodsFor:'accessing'! |
|
62 |
||
140 | 63 |
definingClass |
64 |
^ class |
|
65 |
! |
|
66 |
||
49 | 67 |
value:val inClass:cls here:h |
14 | 68 |
type := #Super. |
69 |
value := val. |
|
49 | 70 |
class := cls. |
71 |
isHere := h |
|
14 | 72 |
! ! |
73 |
||
1080 | 74 |
!SuperNode methodsFor:'printing & storing'! |
14 | 75 |
|
2897
b97e8a922cd2
Implement #displayOn: instead of #displayString
Stefan Vogel <sv@exept.de>
parents:
2605
diff
changeset
|
76 |
displayOn:aGCOrStream |
b97e8a922cd2
Implement #displayOn: instead of #displayString
Stefan Vogel <sv@exept.de>
parents:
2605
diff
changeset
|
77 |
"Compatibility |
4130 | 78 |
append a printed desription on some stream (Dolphin, Squeak) |
2897
b97e8a922cd2
Implement #displayOn: instead of #displayString
Stefan Vogel <sv@exept.de>
parents:
2605
diff
changeset
|
79 |
OR: |
4130 | 80 |
display the receiver in a graphicsContext at 0@0 (ST80). |
2897
b97e8a922cd2
Implement #displayOn: instead of #displayString
Stefan Vogel <sv@exept.de>
parents:
2605
diff
changeset
|
81 |
This method allows for any object to be displayed in some view |
b97e8a922cd2
Implement #displayOn: instead of #displayString
Stefan Vogel <sv@exept.de>
parents:
2605
diff
changeset
|
82 |
(although the fallBack is to display its printString ...)" |
745 | 83 |
|
2897
b97e8a922cd2
Implement #displayOn: instead of #displayString
Stefan Vogel <sv@exept.de>
parents:
2605
diff
changeset
|
84 |
"/ what a kludge - Dolphin and Squeak mean: printOn: a stream; |
4130 | 85 |
"/ old ST80 means: draw-yourself on a GC. |
2897
b97e8a922cd2
Implement #displayOn: instead of #displayString
Stefan Vogel <sv@exept.de>
parents:
2605
diff
changeset
|
86 |
aGCOrStream isStream ifFalse:[ |
b97e8a922cd2
Implement #displayOn: instead of #displayString
Stefan Vogel <sv@exept.de>
parents:
2605
diff
changeset
|
87 |
^ super displayOn:aGCOrStream. |
b97e8a922cd2
Implement #displayOn: instead of #displayString
Stefan Vogel <sv@exept.de>
parents:
2605
diff
changeset
|
88 |
]. |
b97e8a922cd2
Implement #displayOn: instead of #displayString
Stefan Vogel <sv@exept.de>
parents:
2605
diff
changeset
|
89 |
|
b97e8a922cd2
Implement #displayOn: instead of #displayString
Stefan Vogel <sv@exept.de>
parents:
2605
diff
changeset
|
90 |
aGCOrStream |
b97e8a922cd2
Implement #displayOn: instead of #displayString
Stefan Vogel <sv@exept.de>
parents:
2605
diff
changeset
|
91 |
nextPutAll:(isHere ifTrue:['InterpreterVariable(here)'] ifFalse:['InterpreterVariable(super)']). |
4130 | 92 |
|
93 |
"Modified (comment): / 22-02-2017 / 16:52:49 / cg" |
|
745 | 94 |
! |
95 |
||
14 | 96 |
printOn:aStream indent:i |
49 | 97 |
isHere ifTrue:[ |
98 |
aStream nextPutAll:'here' |
|
99 |
] ifFalse:[ |
|
100 |
aStream nextPutAll:'super' |
|
101 |
] |
|
14 | 102 |
! ! |
140 | 103 |
|
2326 | 104 |
!SuperNode methodsFor:'testing'! |
140 | 105 |
|
106 |
isHere |
|
4300 | 107 |
^ isHere ? false |
108 |
||
109 |
"Modified: / 30-08-2018 / 13:25:54 / Claus Gittinger" |
|
140 | 110 |
! |
111 |
||
112 |
isSuper |
|
113 |
"return true, if this is a super-node" |
|
114 |
||
115 |
^ true |
|
3339 | 116 |
! |
117 |
||
118 |
name |
|
119 |
^ self isHere ifTrue:['here'] ifFalse:['super']. |
|
140 | 120 |
! ! |
121 |
||
2605 | 122 |
!SuperNode methodsFor:'visiting'! |
123 |
||
124 |
acceptVisitor:aVisitor |
|
125 |
"Double dispatch back to the visitor, passing my type encoded in |
|
126 |
the selector (visitor pattern)" |
|
127 |
||
128 |
"stub code automatically generated - please change if required" |
|
129 |
||
130 |
^ aVisitor visitSuperNode:self |
|
131 |
! ! |
|
132 |
||
148 | 133 |
!SuperNode class methodsFor:'documentation'! |
134 |
||
135 |
version |
|
4130 | 136 |
^ '$Header$' |
2326 | 137 |
! |
138 |
||
139 |
version_CVS |
|
4130 | 140 |
^ '$Header$' |
148 | 141 |
! ! |
3339 | 142 |