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