1
|
1 |
"{ Package: 'stx:goodies/smaCC' }"
|
|
2 |
|
|
3 |
"{ NameSpace: SmaCC }"
|
|
4 |
|
|
5 |
SmaCCParser subclass:#SmaCCGrammarParser
|
|
6 |
instanceVariableNames:'grammar'
|
|
7 |
classVariableNames:''
|
|
8 |
poolDictionaries:''
|
|
9 |
category:'SmaCC-Parser Generator'
|
|
10 |
!
|
|
11 |
|
|
12 |
SmaCCGrammarParser comment:'SmaCCGrammarParser is a parser for grammars.
|
|
13 |
|
|
14 |
Instance Variables:
|
|
15 |
grammar <SmaCCGrammar> the grammar we are producing
|
|
16 |
'
|
|
17 |
!
|
|
18 |
|
|
19 |
|
|
20 |
!SmaCCGrammarParser class methodsFor:'generated-accessing'!
|
|
21 |
|
|
22 |
scannerClass
|
14
|
23 |
^SmaCC::SmaCCGrammarScanner
|
1
|
24 |
! !
|
|
25 |
|
|
26 |
!SmaCCGrammarParser class methodsFor:'generated-comments'!
|
|
27 |
|
|
28 |
parserDefinitionComment
|
|
29 |
|
14
|
30 |
"File: Parser {grammar addEmptySymbol; yourself};
|
1
|
31 |
|
14
|
32 |
Parser: Rule
|
|
33 |
| Parser Rule ;
|
1
|
34 |
|
|
35 |
Rule : ProductionRule {grammar setStartSymbolIfNone: '1'. nil}
|
14
|
36 |
| LeftLine
|
|
37 |
| RightLine
|
|
38 |
| NonAssociativeLine
|
|
39 |
| IdMethodLine
|
|
40 |
| StartLine ;
|
1
|
41 |
|
14
|
42 |
LeftLine: ""%left"" TokenList 'tokens' "";"" { tokens do: [:each | grammar leftPrecedenceFor: each; setOperatorPrecedenceFor: each to: scanner lineNumber]. nil };
|
|
43 |
RightLine: ""%right"" TokenList 'tokens' "";"" { tokens do: [:each | grammar rightPrecedenceFor: each; setOperatorPrecedenceFor: each to: scanner lineNumber]. nil };
|
1
|
44 |
NonAssociativeLine: ""%nonassoc"" TokenList 'tokens' "";"" { tokens do: [:each | grammar nonAssociativePrecedenceFor: each; setOperatorPrecedenceFor: each to: scanner lineNumber]. nil };
|
|
45 |
IdMethodLine: ""%id"" IdTokens 'tokens' "";"" {tokens do: [:each | grammar makeTokenIdMethodFor: each]. nil};
|
|
46 |
StartLine: ""%start"" StartingTokens "";"";
|
|
47 |
|
|
48 |
IdTokens: <tokenname> {OrderedCollection with: '1' value}
|
14
|
49 |
| IdTokens <tokenname> {'1' add: '2' value; yourself};
|
|
50 |
TokenList: Term
|
|
51 |
| TokenList Term ;
|
1
|
52 |
StartingTokens: <symbolname> 'symbol' {grammar addStartingSymbol: (grammar nonTerminalSymbolNamed: symbol value)}
|
14
|
53 |
| StartingTokens <symbolname> 'symbol' {grammar addStartingSymbol: (grammar nonTerminalSymbolNamed: symbol value)};
|
1
|
54 |
|
|
55 |
ProductionRule: <symbolname> <production> ParserRules "";"" {| symbol | symbol := grammar nonTerminalSymbolNamed: '1' value. '3' do: [:each | symbol addProduction: each]. symbol};
|
|
56 |
|
14
|
57 |
ParserRules: ParserRules ""|"" ParserRule {'1' add: '3'; yourself}
|
|
58 |
| ParserRule ;
|
1
|
59 |
|
|
60 |
ParserRule : Terms 'rhs' {rhs}
|
14
|
61 |
| Terms 'rhs' <code> 'code' {self verifyCodeToken: code for: rhs} ;
|
1
|
62 |
|
14
|
63 |
Terms : {SmaCCRHS new}
|
|
64 |
| Terms 'rhs' Term 'term' {rhs add: term; yourself}
|
|
65 |
| Terms 'rhs' Term 'term' <variablename> 'variableNameToken' {rhs add: term; nameLastItem: (variableNameToken value copyFrom: 2 to: variableNameToken value size - 1); yourself}
|
|
66 |
| Terms 'rhs' Term 'term' ""?"" {rhs add: (grammar makeOptionalSymbolFor: term); yourself}
|
|
67 |
| Terms 'rhs' Term 'term' ""?"" <variablename> 'variableNameToken' {rhs add: (grammar makeOptionalSymbolFor: term); nameLastItem: (variableNameToken value copyFrom: 2 to: variableNameToken value size - 1); yourself}
|
|
68 |
| Terms 'rhs' Term 'term' ""*"" {rhs add: (grammar makeRepeatSymbolFor: term); yourself}
|
|
69 |
| Terms 'rhs' Term 'term' ""*"" <variablename> 'variableNameToken' {rhs add: (grammar makeRepeatSymbolFor: term); nameLastItem: (variableNameToken value copyFrom: 2 to: variableNameToken value size - 1); yourself}
|
|
70 |
| Terms 'rhs' Term 'term' ""+"" {rhs add: (grammar makeRepeatMultipleSymbolFor: term); yourself}
|
|
71 |
| Terms 'rhs' Term 'term' ""+"" <variablename> 'variableNameToken' {rhs add: (grammar makeRepeatMultipleSymbolFor: term); nameLastItem: (variableNameToken value copyFrom: 2 to: variableNameToken value size - 1); yourself} ;
|
1
|
72 |
|
14
|
73 |
Term: <keyword> {grammar keywordTerminalNamed: '1' value}
|
|
74 |
| <tokenname> {grammar terminalSymbolNamed: '1' value ifAbsent: [currentToken := '1'. self reportErrorMessage: 'Token not specified']}
|
|
75 |
| <symbolname> {grammar nonTerminalSymbolNamed: '1' value}
|
|
76 |
| ""error"" {SmaCCSymbol error}
|
|
77 |
| ""("" SimpleTerms "")"" {grammar makeGroupFor: '2'}
|
|
78 |
| ""<%"" SimpleTerms ""%>"" {grammar makeRepeatSymbolFor: (grammar makeGroupFor: '2')}
|
|
79 |
| ""["" SimpleTerms ""]"" {grammar makeOptionalSymbolFor: (grammar makeGroupFor: '2')};
|
1
|
80 |
|
|
81 |
SimpleTerms :
|
14
|
82 |
SimpleTerm {OrderedCollection with: '1'}
|
|
83 |
| SimpleTerms 'terms' ""|"" SimpleTerm 'term' {terms add: term; yourself};
|
1
|
84 |
|
|
85 |
SimpleTerm :
|
14
|
86 |
{ SmaCCRHS new }
|
|
87 |
| SimpleTerm 'rhs' Term 'term' {rhs add: term; yourself}
|
|
88 |
| SimpleTerm 'rhs' Term 'term' ""?"" {rhs add: (grammar makeOptionalSymbolFor: term); yourself}
|
|
89 |
| SimpleTerm 'rhs' Term 'term' ""*"" {rhs add: (grammar makeRepeatSymbolFor: term); yourself}
|
|
90 |
| SimpleTerm 'rhs' Term 'term' ""+"" {rhs add: (grammar makeRepeatMultipleSymbolFor: term); yourself} ;
|
|
91 |
"
|
1
|
92 |
! !
|
|
93 |
|
|
94 |
!SmaCCGrammarParser class methodsFor:'generated-starting states'!
|
|
95 |
|
|
96 |
startingStateForFile
|
|
97 |
^1
|
|
98 |
! !
|
|
99 |
|
|
100 |
!SmaCCGrammarParser methodsFor:'accessing'!
|
|
101 |
|
|
102 |
grammar
|
|
103 |
^grammar
|
|
104 |
!
|
|
105 |
|
|
106 |
grammar: aGrammar
|
|
107 |
grammar := aGrammar
|
|
108 |
! !
|
|
109 |
|
|
110 |
!SmaCCGrammarParser methodsFor:'generated-reduction actions'!
|
|
111 |
|
14
|
112 |
reduceActionForFile1:nodes
|
|
113 |
^ grammar
|
|
114 |
addEmptySymbol;
|
|
115 |
yourself
|
1
|
116 |
!
|
|
117 |
|
14
|
118 |
reduceActionForIdMethodLine1:nodes
|
|
119 |
(nodes at:2) do:[:each |
|
|
120 |
grammar makeTokenIdMethodFor:each
|
|
121 |
].
|
|
122 |
^ nil
|
1
|
123 |
!
|
|
124 |
|
14
|
125 |
reduceActionForIdTokens1:nodes
|
|
126 |
^ OrderedCollection with:(nodes at:1) value
|
1
|
127 |
!
|
|
128 |
|
14
|
129 |
reduceActionForIdTokens2:nodes
|
|
130 |
^ (nodes at:1)
|
|
131 |
add:(nodes at:2) value;
|
|
132 |
yourself
|
1
|
133 |
!
|
|
134 |
|
14
|
135 |
reduceActionForLeftLine1:nodes
|
|
136 |
(nodes at:2) do:[:each |
|
|
137 |
grammar
|
|
138 |
leftPrecedenceFor:each;
|
|
139 |
setOperatorPrecedenceFor:each to:scanner lineNumber
|
|
140 |
].
|
|
141 |
^ nil
|
1
|
142 |
!
|
|
143 |
|
14
|
144 |
reduceActionForNonAssociativeLine1:nodes
|
|
145 |
(nodes at:2) do:[:each |
|
|
146 |
grammar
|
|
147 |
nonAssociativePrecedenceFor:each;
|
|
148 |
setOperatorPrecedenceFor:each to:scanner lineNumber
|
|
149 |
].
|
|
150 |
^ nil
|
1
|
151 |
!
|
|
152 |
|
14
|
153 |
reduceActionForParserRule1:nodes
|
|
154 |
^ nodes at:1
|
1
|
155 |
!
|
|
156 |
|
14
|
157 |
reduceActionForParserRule2:nodes
|
|
158 |
^ self verifyCodeToken:(nodes at:2) for:(nodes at:1)
|
1
|
159 |
!
|
|
160 |
|
14
|
161 |
reduceActionForParserRules1:nodes
|
|
162 |
^ (nodes at:1)
|
|
163 |
add:(nodes at:3);
|
|
164 |
yourself
|
1
|
165 |
!
|
|
166 |
|
14
|
167 |
reduceActionForProductionRule1:nodes
|
|
168 |
|symbol|
|
|
169 |
|
|
170 |
symbol := grammar nonTerminalSymbolNamed:(nodes at:1) value.
|
|
171 |
(nodes at:3) do:[:each |
|
|
172 |
symbol addProduction:each
|
|
173 |
].
|
|
174 |
^ symbol
|
1
|
175 |
!
|
|
176 |
|
14
|
177 |
reduceActionForRightLine1:nodes
|
|
178 |
(nodes at:2) do:[:each |
|
|
179 |
grammar
|
|
180 |
rightPrecedenceFor:each;
|
|
181 |
setOperatorPrecedenceFor:each to:scanner lineNumber
|
|
182 |
].
|
|
183 |
^ nil
|
1
|
184 |
!
|
|
185 |
|
14
|
186 |
reduceActionForRule1:nodes
|
|
187 |
grammar setStartSymbolIfNone:(nodes at:1).
|
|
188 |
^ nil
|
1
|
189 |
!
|
|
190 |
|
14
|
191 |
reduceActionForSimpleTerm1:nodes
|
|
192 |
^ SmaCCRHS new
|
|
193 |
!
|
|
194 |
|
|
195 |
reduceActionForSimpleTerm2:nodes
|
|
196 |
^ (nodes at:1)
|
|
197 |
add:(nodes at:2);
|
|
198 |
yourself
|
1
|
199 |
!
|
|
200 |
|
14
|
201 |
reduceActionForSimpleTerm3:nodes
|
|
202 |
^ (nodes at:1)
|
|
203 |
add:(grammar makeOptionalSymbolFor:(nodes at:2));
|
|
204 |
yourself
|
1
|
205 |
!
|
|
206 |
|
14
|
207 |
reduceActionForSimpleTerm4:nodes
|
|
208 |
^ (nodes at:1)
|
|
209 |
add:(grammar makeRepeatSymbolFor:(nodes at:2));
|
|
210 |
yourself
|
1
|
211 |
!
|
|
212 |
|
14
|
213 |
reduceActionForSimpleTerm5:nodes
|
|
214 |
^ (nodes at:1)
|
|
215 |
add:(grammar makeRepeatMultipleSymbolFor:(nodes at:2));
|
|
216 |
yourself
|
1
|
217 |
!
|
|
218 |
|
14
|
219 |
reduceActionForSimpleTerms1:nodes
|
|
220 |
^ OrderedCollection with:(nodes at:1)
|
1
|
221 |
!
|
|
222 |
|
14
|
223 |
reduceActionForSimpleTerms2:nodes
|
|
224 |
^ (nodes at:1)
|
|
225 |
add:(nodes at:3);
|
|
226 |
yourself
|
1
|
227 |
!
|
|
228 |
|
14
|
229 |
reduceActionForStartingTokens1:nodes
|
|
230 |
^ grammar
|
|
231 |
addStartingSymbol:(grammar nonTerminalSymbolNamed:(nodes at:1) value)
|
1
|
232 |
!
|
|
233 |
|
14
|
234 |
reduceActionForStartingTokens2:nodes
|
|
235 |
^ grammar
|
|
236 |
addStartingSymbol:(grammar nonTerminalSymbolNamed:(nodes at:2) value)
|
1
|
237 |
!
|
|
238 |
|
14
|
239 |
reduceActionForTerm1:nodes
|
|
240 |
^ grammar keywordTerminalNamed:(nodes at:1) value
|
1
|
241 |
!
|
|
242 |
|
14
|
243 |
reduceActionForTerm2:nodes
|
|
244 |
^ grammar terminalSymbolNamed:(nodes at:1) value
|
|
245 |
ifAbsent:[
|
|
246 |
currentToken := nodes at:1.
|
|
247 |
self reportErrorMessage:'Token not specified'
|
|
248 |
]
|
1
|
249 |
!
|
|
250 |
|
14
|
251 |
reduceActionForTerm3:nodes
|
|
252 |
^ grammar nonTerminalSymbolNamed:(nodes at:1) value
|
1
|
253 |
!
|
|
254 |
|
14
|
255 |
reduceActionForTerm4:nodes
|
|
256 |
^ SmaCCSymbol error
|
1
|
257 |
!
|
|
258 |
|
14
|
259 |
reduceActionForTerm5:nodes
|
|
260 |
^ grammar makeGroupFor:(nodes at:2)
|
1
|
261 |
!
|
|
262 |
|
14
|
263 |
reduceActionForTerm6:nodes
|
|
264 |
^ grammar makeRepeatSymbolFor:(grammar makeGroupFor:(nodes at:2))
|
1
|
265 |
!
|
|
266 |
|
14
|
267 |
reduceActionForTerm7:nodes
|
|
268 |
^ grammar makeOptionalSymbolFor:(grammar makeGroupFor:(nodes at:2))
|
1
|
269 |
!
|
|
270 |
|
14
|
271 |
reduceActionForTerms1:nodes
|
|
272 |
^ SmaCCRHS new
|
1
|
273 |
!
|
|
274 |
|
14
|
275 |
reduceActionForTerms2:nodes
|
|
276 |
^ (nodes at:1)
|
|
277 |
add:(nodes at:2);
|
|
278 |
yourself
|
1
|
279 |
!
|
|
280 |
|
14
|
281 |
reduceActionForTerms3:nodes
|
|
282 |
^ (nodes at:1)
|
|
283 |
add:(nodes at:2);
|
|
284 |
nameLastItem:((nodes at:3) value copyFrom:2
|
|
285 |
to:(nodes at:3) value size - 1);
|
|
286 |
yourself
|
1
|
287 |
!
|
|
288 |
|
14
|
289 |
reduceActionForTerms4:nodes
|
|
290 |
^ (nodes at:1)
|
|
291 |
add:(grammar makeOptionalSymbolFor:(nodes at:2));
|
|
292 |
yourself
|
1
|
293 |
!
|
|
294 |
|
14
|
295 |
reduceActionForTerms5:nodes
|
|
296 |
^ (nodes at:1)
|
|
297 |
add:(grammar makeOptionalSymbolFor:(nodes at:2));
|
|
298 |
nameLastItem:((nodes at:4) value copyFrom:2
|
|
299 |
to:(nodes at:4) value size - 1);
|
|
300 |
yourself
|
1
|
301 |
!
|
|
302 |
|
14
|
303 |
reduceActionForTerms6:nodes
|
|
304 |
^ (nodes at:1)
|
|
305 |
add:(grammar makeRepeatSymbolFor:(nodes at:2));
|
|
306 |
yourself
|
1
|
307 |
!
|
|
308 |
|
14
|
309 |
reduceActionForTerms7:nodes
|
|
310 |
^ (nodes at:1)
|
|
311 |
add:(grammar makeRepeatSymbolFor:(nodes at:2));
|
|
312 |
nameLastItem:((nodes at:4) value copyFrom:2
|
|
313 |
to:(nodes at:4) value size - 1);
|
|
314 |
yourself
|
1
|
315 |
!
|
|
316 |
|
14
|
317 |
reduceActionForTerms8:nodes
|
|
318 |
^ (nodes at:1)
|
|
319 |
add:(grammar makeRepeatMultipleSymbolFor:(nodes at:2));
|
|
320 |
yourself
|
1
|
321 |
!
|
|
322 |
|
14
|
323 |
reduceActionForTerms9:nodes
|
|
324 |
^ (nodes at:1)
|
|
325 |
add:(grammar makeRepeatMultipleSymbolFor:(nodes at:2));
|
|
326 |
nameLastItem:((nodes at:4) value copyFrom:2
|
|
327 |
to:(nodes at:4) value size - 1);
|
|
328 |
yourself
|
1
|
329 |
! !
|
|
330 |
|
|
331 |
!SmaCCGrammarParser methodsFor:'generated-tables'!
|
|
332 |
|
|
333 |
reduceTable
|
|
334 |
^#(
|
14
|
335 |
#(26 3 #reduceActionForIdMethodLine1:)
|
|
336 |
#(27 3 #reduceFor:)
|
|
337 |
#(28 1 #reduceFor:)
|
|
338 |
#(28 2 #reduceFor:)
|
|
339 |
#(29 4 #reduceActionForProductionRule1:)
|
|
340 |
#(30 3 #reduceActionForRightLine1:)
|
|
341 |
#(31 1 #reduceActionForRule1:)
|
|
342 |
#(31 1 #reduceFor:)
|
|
343 |
#(31 1 #reduceFor:)
|
|
344 |
#(31 1 #reduceFor:)
|
|
345 |
#(31 1 #reduceFor:)
|
1
|
346 |
#(31 1 #reduceFor:)
|
14
|
347 |
#(32 1 #reduceActionForTerm1:)
|
|
348 |
#(32 1 #reduceActionForTerm2:)
|
|
349 |
#(32 1 #reduceActionForTerm3:)
|
|
350 |
#(32 1 #reduceActionForTerm4:)
|
|
351 |
#(32 3 #reduceActionForTerm5:)
|
|
352 |
#(32 3 #reduceActionForTerm6:)
|
|
353 |
#(32 3 #reduceActionForTerm7:)
|
|
354 |
#(33 1 #reduceFor:)
|
|
355 |
#(34 3 #reduceActionForNonAssociativeLine1:)
|
|
356 |
#(35 3 #reduceActionForParserRules1:)
|
|
357 |
#(35 1 #reduceFor:)
|
|
358 |
#(36 1 #reduceActionForParserRule1:)
|
|
359 |
#(36 2 #reduceActionForParserRule2:)
|
|
360 |
#(37 0 #reduceActionForTerms1:)
|
|
361 |
#(37 2 #reduceActionForTerms2:)
|
|
362 |
#(37 3 #reduceActionForTerms3:)
|
|
363 |
#(37 3 #reduceActionForTerms4:)
|
|
364 |
#(37 4 #reduceActionForTerms5:)
|
|
365 |
#(37 3 #reduceActionForTerms6:)
|
|
366 |
#(37 4 #reduceActionForTerms7:)
|
|
367 |
#(37 3 #reduceActionForTerms8:)
|
|
368 |
#(37 4 #reduceActionForTerms9:)
|
|
369 |
#(38 1 #reduceActionForStartingTokens1:)
|
|
370 |
#(38 2 #reduceActionForStartingTokens2:)
|
|
371 |
#(39 1 #reduceFor:)
|
|
372 |
#(39 2 #reduceFor:)
|
|
373 |
#(40 1 #reduceActionForIdTokens1:)
|
|
374 |
#(40 2 #reduceActionForIdTokens2:)
|
|
375 |
#(41 1 #reduceActionForSimpleTerms1:)
|
|
376 |
#(41 3 #reduceActionForSimpleTerms2:)
|
|
377 |
#(42 0 #reduceActionForSimpleTerm1:)
|
|
378 |
#(42 2 #reduceActionForSimpleTerm2:)
|
|
379 |
#(42 3 #reduceActionForSimpleTerm3:)
|
|
380 |
#(42 3 #reduceActionForSimpleTerm4:)
|
|
381 |
#(42 3 #reduceActionForSimpleTerm5:)
|
|
382 |
#(45 1 #reduceActionForFile1:)
|
|
383 |
#(46 3 #reduceActionForLeftLine1:)
|
1
|
384 |
)
|
|
385 |
!
|
|
386 |
|
|
387 |
transitionTable
|
|
388 |
^#(
|
14
|
389 |
#[1 0 9 0 1 0 13 0 3 0 17 0 4 0 21 0 6 0 25 0 8 0 29 0 20 0 33 0 26 0 37 0 27 0 41 0 29 0 45 0 30 0 49 0 31 0 53 0 34 0 57 0 39 0 61 0 45 0 65 0 46]
|
|
390 |
#[1 0 69 0 20 0 73 0 38]
|
|
391 |
#[1 0 77 0 11 0 81 0 13 0 85 0 16 0 89 0 17 0 93 0 19 0 97 0 20 0 101 0 21 0 105 0 28 0 109 0 32]
|
|
392 |
#[1 0 113 0 19 0 117 0 40]
|
|
393 |
#[1 0 77 0 11 0 81 0 13 0 85 0 16 0 89 0 17 0 93 0 19 0 97 0 20 0 101 0 21 0 121 0 28 0 109 0 32]
|
|
394 |
#[1 0 77 0 11 0 81 0 13 0 85 0 16 0 89 0 17 0 93 0 19 0 97 0 20 0 101 0 21 0 125 0 28 0 109 0 32]
|
1
|
395 |
#[0 0 129 0 25]
|
14
|
396 |
#[0 0 46 0 1 0 3 0 4 0 6 0 8 0 20 0 43]
|
|
397 |
#[0 0 50 0 1 0 3 0 4 0 6 0 8 0 20 0 43]
|
|
398 |
#[0 0 30 0 1 0 3 0 4 0 6 0 8 0 20 0 43]
|
|
399 |
#[0 0 38 0 1 0 3 0 4 0 6 0 8 0 20 0 43]
|
|
400 |
#[0 0 150 0 1 0 3 0 4 0 6 0 8 0 20 0 43]
|
|
401 |
#[0 0 42 0 1 0 3 0 4 0 6 0 8 0 20 0 43]
|
|
402 |
#[1 0 9 0 1 0 13 0 3 0 17 0 4 0 21 0 6 0 25 0 8 0 29 0 20 0 33 0 26 0 37 0 27 0 41 0 29 0 45 0 30 0 133 0 31 0 53 0 34 0 194 0 43 0 65 0 46]
|
|
403 |
#[0 0 0 0 43]
|
|
404 |
#[0 0 34 0 1 0 3 0 4 0 6 0 8 0 20 0 43]
|
|
405 |
#[0 0 142 0 7 0 20]
|
|
406 |
#[1 0 137 0 7 0 141 0 20]
|
|
407 |
#[1 0 174 0 2 0 174 0 11 0 174 0 13 0 174 0 14 0 174 0 16 0 174 0 17 0 174 0 19 0 174 0 20 0 174 0 21 0 145 0 41 0 149 0 42]
|
|
408 |
#[1 0 174 0 2 0 174 0 10 0 174 0 11 0 174 0 13 0 174 0 16 0 174 0 17 0 174 0 19 0 174 0 20 0 174 0 21 0 153 0 41 0 149 0 42]
|
|
409 |
#[0 0 66 0 2 0 5 0 7 0 9 0 10 0 11 0 12 0 13 0 14 0 15 0 16 0 17 0 19 0 20 0 21 0 23 0 24]
|
|
410 |
#[1 0 174 0 2 0 174 0 11 0 174 0 12 0 174 0 13 0 174 0 16 0 174 0 17 0 174 0 19 0 174 0 20 0 174 0 21 0 157 0 41 0 149 0 42]
|
|
411 |
#[0 0 58 0 2 0 5 0 7 0 9 0 10 0 11 0 12 0 13 0 14 0 15 0 16 0 17 0 19 0 20 0 21 0 23 0 24]
|
|
412 |
#[0 0 62 0 2 0 5 0 7 0 9 0 10 0 11 0 12 0 13 0 14 0 15 0 16 0 17 0 19 0 20 0 21 0 23 0 24]
|
|
413 |
#[0 0 54 0 2 0 5 0 7 0 9 0 10 0 11 0 12 0 13 0 14 0 15 0 16 0 17 0 19 0 20 0 21 0 23 0 24]
|
|
414 |
#[1 0 161 0 7 0 77 0 11 0 81 0 13 0 85 0 16 0 89 0 17 0 93 0 19 0 97 0 20 0 101 0 21 0 165 0 32]
|
|
415 |
#[0 0 14 0 7 0 11 0 13 0 16 0 17 0 19 0 20 0 21]
|
|
416 |
#[0 0 158 0 7 0 19]
|
|
417 |
#[1 0 169 0 7 0 173 0 19]
|
|
418 |
#[1 0 177 0 7 0 77 0 11 0 81 0 13 0 85 0 16 0 89 0 17 0 93 0 19 0 97 0 20 0 101 0 21 0 165 0 32]
|
|
419 |
#[1 0 181 0 7 0 77 0 11 0 81 0 13 0 85 0 16 0 89 0 17 0 93 0 19 0 97 0 20 0 101 0 21 0 165 0 32]
|
|
420 |
#[1 0 106 0 2 0 106 0 7 0 106 0 11 0 106 0 13 0 106 0 16 0 106 0 17 0 106 0 19 0 106 0 20 0 106 0 21 0 106 0 23 0 185 0 35 0 189 0 36 0 193 0 37]
|
|
421 |
#[0 0 154 0 1 0 3 0 4 0 6 0 8 0 20 0 43]
|
|
422 |
#[0 0 10 0 1 0 3 0 4 0 6 0 8 0 20 0 43]
|
|
423 |
#[0 0 146 0 7 0 20]
|
|
424 |
#[1 0 197 0 2 0 201 0 14]
|
|
425 |
#[1 0 166 0 2 0 166 0 10 0 77 0 11 0 166 0 12 0 81 0 13 0 166 0 14 0 85 0 16 0 89 0 17 0 93 0 19 0 97 0 20 0 101 0 21 0 205 0 32]
|
|
426 |
#[1 0 197 0 2 0 209 0 10]
|
|
427 |
#[1 0 197 0 2 0 213 0 12]
|
|
428 |
#[0 0 86 0 1 0 3 0 4 0 6 0 8 0 20 0 43]
|
|
429 |
#[0 0 18 0 7 0 11 0 13 0 16 0 17 0 19 0 20 0 21]
|
|
430 |
#[0 0 6 0 1 0 3 0 4 0 6 0 8 0 20 0 43]
|
|
431 |
#[0 0 162 0 7 0 19]
|
|
432 |
#[0 0 198 0 1 0 3 0 4 0 6 0 8 0 20 0 43]
|
|
433 |
#[0 0 26 0 1 0 3 0 4 0 6 0 8 0 20 0 43]
|
|
434 |
#[1 0 217 0 2 0 221 0 7]
|
|
435 |
#[0 0 94 0 2 0 7]
|
|
436 |
#[1 0 98 0 2 0 98 0 7 0 77 0 11 0 81 0 13 0 85 0 16 0 89 0 17 0 93 0 19 0 97 0 20 0 101 0 21 0 225 0 23 0 229 0 32]
|
|
437 |
#[1 0 174 0 2 0 174 0 10 0 174 0 11 0 174 0 12 0 174 0 13 0 174 0 14 0 174 0 16 0 174 0 17 0 174 0 19 0 174 0 20 0 174 0 21 0 233 0 42]
|
|
438 |
#[0 0 78 0 2 0 5 0 7 0 9 0 10 0 11 0 12 0 13 0 14 0 15 0 16 0 17 0 19 0 20 0 21 0 23 0 24]
|
|
439 |
#[1 0 178 0 2 0 237 0 5 0 241 0 9 0 178 0 10 0 178 0 11 0 178 0 12 0 178 0 13 0 178 0 14 0 245 0 15 0 178 0 16 0 178 0 17 0 178 0 19 0 178 0 20 0 178 0 21]
|
|
440 |
#[0 0 74 0 2 0 5 0 7 0 9 0 10 0 11 0 12 0 13 0 14 0 15 0 16 0 17 0 19 0 20 0 21 0 23 0 24]
|
|
441 |
#[0 0 70 0 2 0 5 0 7 0 9 0 10 0 11 0 12 0 13 0 14 0 15 0 16 0 17 0 19 0 20 0 21 0 23 0 24]
|
|
442 |
#[1 0 106 0 2 0 106 0 7 0 106 0 11 0 106 0 13 0 106 0 16 0 106 0 17 0 106 0 19 0 106 0 20 0 106 0 21 0 106 0 23 0 249 0 36 0 193 0 37]
|
|
443 |
#[0 0 22 0 1 0 3 0 4 0 6 0 8 0 20 0 43]
|
|
444 |
#[0 0 102 0 2 0 7]
|
|
445 |
#[1 0 110 0 2 0 253 0 5 0 110 0 7 1 1 0 9 0 110 0 11 0 110 0 13 1 5 0 15 0 110 0 16 0 110 0 17 0 110 0 19 0 110 0 20 0 110 0 21 0 110 0 23 1 9 0 24]
|
|
446 |
#[1 0 170 0 2 0 170 0 10 0 77 0 11 0 170 0 12 0 81 0 13 0 170 0 14 0 85 0 16 0 89 0 17 0 93 0 19 0 97 0 20 0 101 0 21 0 205 0 32]
|
|
447 |
#[0 0 182 0 2 0 10 0 11 0 12 0 13 0 14 0 16 0 17 0 19 0 20 0 21]
|
|
448 |
#[0 0 186 0 2 0 10 0 11 0 12 0 13 0 14 0 16 0 17 0 19 0 20 0 21]
|
|
449 |
#[0 0 190 0 2 0 10 0 11 0 12 0 13 0 14 0 16 0 17 0 19 0 20 0 21]
|
|
450 |
#[0 0 90 0 2 0 7]
|
|
451 |
#[1 0 118 0 2 0 118 0 7 0 118 0 11 0 118 0 13 0 118 0 16 0 118 0 17 0 118 0 19 0 118 0 20 0 118 0 21 0 118 0 23 1 13 0 24]
|
|
452 |
#[1 0 126 0 2 0 126 0 7 0 126 0 11 0 126 0 13 0 126 0 16 0 126 0 17 0 126 0 19 0 126 0 20 0 126 0 21 0 126 0 23 1 17 0 24]
|
|
453 |
#[1 0 134 0 2 0 134 0 7 0 134 0 11 0 134 0 13 0 134 0 16 0 134 0 17 0 134 0 19 0 134 0 20 0 134 0 21 0 134 0 23 1 21 0 24]
|
|
454 |
#[0 0 114 0 2 0 7 0 11 0 13 0 16 0 17 0 19 0 20 0 21 0 23]
|
|
455 |
#[0 0 122 0 2 0 7 0 11 0 13 0 16 0 17 0 19 0 20 0 21 0 23]
|
|
456 |
#[0 0 130 0 2 0 7 0 11 0 13 0 16 0 17 0 19 0 20 0 21 0 23]
|
|
457 |
#[0 0 138 0 2 0 7 0 11 0 13 0 16 0 17 0 19 0 20 0 21 0 23]
|
1
|
458 |
)
|
|
459 |
! !
|
|
460 |
|
|
461 |
!SmaCCGrammarParser methodsFor:'initialize-release'!
|
|
462 |
|
|
463 |
initialize
|
|
464 |
super initialize.
|
|
465 |
grammar := SmaCCGrammar new
|
|
466 |
! !
|
|
467 |
|
|
468 |
!SmaCCGrammarParser methodsFor:'private'!
|
|
469 |
|
|
470 |
verifyCodeToken: codeToken for: aRHS
|
|
471 |
| code |
|
|
472 |
code := codeToken value copyFrom: 2 to: codeToken value size - 1.
|
|
473 |
RBParser parseExpression: code
|
|
474 |
onError:
|
|
475 |
[:string :position |
|
|
476 |
currentToken := nil.
|
|
477 |
scanner position: codeToken startPosition + position.
|
|
478 |
self reportErrorMessage: string].
|
|
479 |
aRHS reduceAction: code.
|
|
480 |
^aRHS
|
|
481 |
! !
|
|
482 |
|
|
483 |
!SmaCCGrammarParser class methodsFor:'documentation'!
|
|
484 |
|
|
485 |
version
|
|
486 |
^ '$Header: /opt/data/cvs/stx/goodies/smaCC/SmaCC__SmaCCGrammarParser.st,v 1.1 2006-02-09 21:18:56 vranyj1 Exp $'
|
14
|
487 |
!
|
|
488 |
|
|
489 |
version_SVN
|
|
490 |
^ '$Id$'
|
1
|
491 |
! !
|