4557
|
1 |
"{ Encoding: utf8 }"
|
|
2 |
|
2512
|
3 |
"
|
|
4 |
COPYRIGHT (c) 2006 by eXept Software AG
|
|
5 |
All Rights Reserved
|
|
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 |
"
|
|
14 |
"{ Package: 'stx:libcomp' }"
|
|
15 |
|
3609
|
16 |
"{ NameSpace: Smalltalk }"
|
|
17 |
|
2512
|
18 |
ParseNode subclass:#BreakpointNode
|
2540
|
19 |
instanceVariableNames:'breakpoint expression lineNumber'
|
2512
|
20 |
classVariableNames:''
|
|
21 |
poolDictionaries:''
|
|
22 |
category:'System-Compiler-Debugging'
|
|
23 |
!
|
|
24 |
|
|
25 |
!BreakpointNode class methodsFor:'documentation'!
|
|
26 |
|
|
27 |
copyright
|
|
28 |
"
|
|
29 |
COPYRIGHT (c) 2006 by eXept Software AG
|
|
30 |
All Rights Reserved
|
|
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 |
"
|
3346
|
39 |
!
|
|
40 |
|
|
41 |
documentation
|
|
42 |
"
|
|
43 |
compiler support for statement breakpoints.
|
|
44 |
"
|
2512
|
45 |
! !
|
|
46 |
|
|
47 |
!BreakpointNode methodsFor:'accessing'!
|
|
48 |
|
|
49 |
breakpoint
|
|
50 |
^ breakpoint
|
|
51 |
!
|
|
52 |
|
|
53 |
breakpoint:something
|
|
54 |
breakpoint := something.
|
|
55 |
!
|
|
56 |
|
4513
|
57 |
endPosition
|
|
58 |
^ expression endPosition
|
|
59 |
!
|
|
60 |
|
2512
|
61 |
expression
|
|
62 |
^ expression
|
|
63 |
!
|
|
64 |
|
|
65 |
expression:something
|
|
66 |
expression := something.
|
2540
|
67 |
!
|
|
68 |
|
|
69 |
lineNumber
|
|
70 |
^ lineNumber
|
|
71 |
!
|
|
72 |
|
3466
|
73 |
lineNumber:lineNumberArg
|
|
74 |
self assert:(lineNumberArg >= 0).
|
|
75 |
lineNumber := lineNumberArg.
|
3482
|
76 |
!
|
|
77 |
|
|
78 |
realNode
|
|
79 |
^ expression
|
3515
|
80 |
!
|
|
81 |
|
|
82 |
selectorPosition
|
|
83 |
^ expression selectorPosition
|
4513
|
84 |
!
|
|
85 |
|
|
86 |
startPosition
|
|
87 |
^ expression startPosition
|
2512
|
88 |
! !
|
|
89 |
|
|
90 |
!BreakpointNode methodsFor:'code generation'!
|
|
91 |
|
3349
|
92 |
codeForCascadeOn:aStream inBlock:b for:aCompiler
|
|
93 |
|node|
|
|
94 |
|
4222
|
95 |
node := UnaryNode
|
3349
|
96 |
receiver: (ConstantNode value: breakpoint)
|
|
97 |
selector: #break.
|
|
98 |
node lineNumber:lineNumber.
|
|
99 |
node codeForSideEffectOn:aStream inBlock:b for:aCompiler.
|
|
100 |
expression notNil ifTrue:[
|
|
101 |
expression codeForCascadeOn:aStream inBlock:b for:aCompiler
|
|
102 |
].
|
4222
|
103 |
|
|
104 |
"Modified: / 26-03-2018 / 15:39:38 / stefan"
|
3349
|
105 |
!
|
|
106 |
|
3446
|
107 |
codeForSideEffectOn:aStream inBlock:b for:aCompiler
|
|
108 |
|node|
|
|
109 |
|
4222
|
110 |
node := UnaryNode
|
3446
|
111 |
receiver: (ConstantNode value: breakpoint)
|
|
112 |
selector: #break.
|
|
113 |
node lineNumber:lineNumber.
|
|
114 |
node codeForSideEffectOn:aStream inBlock:b for:aCompiler.
|
|
115 |
expression notNil ifTrue:[
|
|
116 |
expression codeForSideEffectOn:aStream inBlock:b for:aCompiler
|
|
117 |
].
|
4222
|
118 |
|
|
119 |
"Modified: / 26-03-2018 / 15:39:33 / stefan"
|
3446
|
120 |
!
|
|
121 |
|
2512
|
122 |
codeOn:aStream inBlock:codeBlock for:aCompiler
|
2540
|
123 |
|node|
|
2512
|
124 |
|
4594
|
125 |
"/ Transcript showCR:'**** bpCode: %1 expr: %2' with:lineNumber with:expression printString.
|
|
126 |
|
4222
|
127 |
node := UnaryNode
|
2540
|
128 |
receiver: (ConstantNode value: breakpoint)
|
|
129 |
selector: #break.
|
|
130 |
node lineNumber:lineNumber.
|
|
131 |
node codeForSideEffectOn:aStream inBlock:codeBlock for:aCompiler.
|
3226
|
132 |
expression notNil ifTrue:[
|
|
133 |
expression codeOn:aStream inBlock:codeBlock for:aCompiler
|
|
134 |
].
|
2512
|
135 |
|
|
136 |
"Created: / 16-06-2011 / 15:17:09 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
3226
|
137 |
"Modified: / 22-07-2013 / 16:08:34 / cg"
|
4222
|
138 |
"Modified: / 26-03-2018 / 15:38:22 / stefan"
|
2512
|
139 |
! !
|
|
140 |
|
4513
|
141 |
!BreakpointNode methodsFor:'enumerating'!
|
|
142 |
|
|
143 |
childrenDo:aBlock
|
|
144 |
aBlock value:expression
|
|
145 |
! !
|
|
146 |
|
4365
|
147 |
!BreakpointNode methodsFor:'evaluation'!
|
|
148 |
|
|
149 |
evaluateIn:anEnvironment
|
|
150 |
^ expression evaluateIn:anEnvironment
|
|
151 |
|
|
152 |
"Created: / 20-02-2019 / 22:17:35 / Claus Gittinger"
|
|
153 |
! !
|
|
154 |
|
3350
|
155 |
!BreakpointNode methodsFor:'node protocol forwarding'!
|
2544
|
156 |
|
3350
|
157 |
arg1
|
|
158 |
"must forward - otherwise cascades won't work"
|
2544
|
159 |
|
3350
|
160 |
^ expression arg1
|
|
161 |
!
|
2534
|
162 |
|
3609
|
163 |
args
|
|
164 |
"must forward - otherwise keywordExpression won't work"
|
|
165 |
|
|
166 |
^ expression args
|
|
167 |
!
|
|
168 |
|
3640
|
169 |
argumentCount
|
|
170 |
"must forward - otherwise checkCondition won't work"
|
|
171 |
|
|
172 |
^ expression argumentCount
|
|
173 |
!
|
|
174 |
|
3350
|
175 |
arguments
|
|
176 |
"must forward - otherwise cascades won't work"
|
2534
|
177 |
|
3350
|
178 |
^ expression arguments
|
3349
|
179 |
!
|
|
180 |
|
|
181 |
isMessage
|
|
182 |
"must forward - otherwise cascades won't work"
|
|
183 |
|
|
184 |
^ expression isMessage
|
|
185 |
!
|
|
186 |
|
3610
|
187 |
numArgs
|
4557
|
188 |
<resource: #obsolete>
|
|
189 |
|
4072
|
190 |
"must forward - otherwise checkCondition won't work.
|
|
191 |
Please use argumentCount, which is ANSI"
|
3610
|
192 |
|
|
193 |
^ expression numArgs
|
|
194 |
!
|
|
195 |
|
4047
|
196 |
plausibilityCheckIn:aParser
|
|
197 |
^ expression plausibilityCheckIn:aParser
|
|
198 |
|
|
199 |
"Created: / 20-11-2016 / 19:17:54 / cg"
|
|
200 |
!
|
|
201 |
|
3349
|
202 |
receiver
|
|
203 |
"must forward - otherwise cascades won't work"
|
|
204 |
|
|
205 |
^ expression receiver
|
|
206 |
!
|
|
207 |
|
|
208 |
selector
|
|
209 |
"must forward - otherwise cascades won't work"
|
|
210 |
|
|
211 |
^ expression selector
|
2534
|
212 |
! !
|
|
213 |
|
3350
|
214 |
!BreakpointNode methodsFor:'printing'!
|
|
215 |
|
|
216 |
printOn:aStream indent:indent
|
|
217 |
"append a user printed representation of the receiver to aStream.
|
|
218 |
The format is suitable for a human - not meant to be read back."
|
|
219 |
|
4594
|
220 |
aStream show:'BP [%1] before: ' with:lineNumber.
|
|
221 |
expression printOn:aStream indent:indent.
|
3350
|
222 |
|
|
223 |
"Created: / 06-07-2011 / 14:31:10 / cg"
|
|
224 |
! !
|
|
225 |
|
|
226 |
!BreakpointNode methodsFor:'testing'!
|
|
227 |
|
|
228 |
isBreakPointNode
|
|
229 |
^ true
|
|
230 |
|
|
231 |
"Created: / 05-07-2011 / 21:13:52 / cg"
|
|
232 |
! !
|
|
233 |
|
2512
|
234 |
!BreakpointNode class methodsFor:'documentation'!
|
|
235 |
|
3350
|
236 |
version
|
4047
|
237 |
^ '$Header$'
|
3350
|
238 |
!
|
|
239 |
|
2512
|
240 |
version_CVS
|
4047
|
241 |
^ '$Header$'
|
2512
|
242 |
!
|
|
243 |
|
|
244 |
version_SVN
|
3226
|
245 |
^ '$ Id $'
|
2512
|
246 |
! !
|
3226
|
247 |
|