nitc: use is_generated in various tools and generated files
[nit.git] / contrib / pep8analysis / src / parser / parser.nit
1 # Parser.
2 # This file was generated by SableCC (http://www.sablecc.org/).
3 module parser is generated, no_warning("missing-doc", "old-init")
4
5 intrude import parser_prod
6 import tables
7
8 # State of the parser automata as stored in the parser stack.
9 private class State
10 # The internal state number
11 var state: Int
12
13 # The node stored with the state in the stack
14 var nodes: nullable Object
15
16 init(state: Int, nodes: nullable Object)
17 do
18 self.state = state
19 self.nodes = nodes
20 end
21 end
22
23 class Parser
24 super TablesCapable
25 # Associated lexer
26 var lexer: Lexer
27
28 # Stack of pushed states and productions
29 private var stack: Array[State]
30
31 # Position in the stack
32 private var stack_pos: Int
33
34 # Create a new parser based on a given lexer
35 init(lexer: Lexer)
36 do
37 _lexer = lexer
38 _stack = new Array[State]
39 _stack_pos = -1
40 build_reduce_table
41 end
42
43 # Do a transition in the automata
44 private fun go_to(index: Int): Int
45 do
46 var state = state
47 var low = 1
48 var high = parser_goto(index, 0) - 1
49
50 while low <= high do
51 var middle = (low + high) / 2
52 var subindex = middle * 2 + 1 # +1 because parser_goto(index, 0) is the length
53
54 var goal = parser_goto(index, subindex)
55 if state < goal then
56 high = middle - 1
57 else if state > goal then
58 low = middle + 1
59 else
60 return parser_goto(index, subindex+1)
61 end
62 end
63
64 return parser_goto(index, 2) # Default value
65 end
66
67 # Push someting in the state stack
68 private fun push(numstate: Int, list_node: nullable Object)
69 do
70 var pos = _stack_pos + 1
71 _stack_pos = pos
72 if pos < _stack.length then
73 var state = _stack[pos]
74 state.state = numstate
75 state.nodes = list_node
76 else
77 _stack.push(new State(numstate, list_node))
78 end
79 end
80
81 # The current state
82 private fun state: Int
83 do
84 return _stack[_stack_pos].state
85 end
86
87 # Pop something from the stack state
88 private fun pop: nullable Object
89 do
90 var res = _stack[_stack_pos].nodes
91 _stack_pos = _stack_pos -1
92 return res
93 end
94
95 # Build and return a full AST.
96 fun parse: Start
97 do
98 push(0, null)
99
100 var lexer = _lexer
101 loop
102 var token = lexer.peek
103 if token isa AError then
104 return new Start(null, token)
105 end
106
107 var state = self.state
108 var index = token.parser_index
109 var action_type = parser_action(state, 2)
110 var action_value = parser_action(state, 3)
111
112 var low = 1
113 var high = parser_action(state, 0) - 1
114
115 while low <= high do
116 var middle = (low + high) / 2
117 var subindex = middle * 3 + 1 # +1 because parser_action(state, 0) is the length
118
119 var goal = parser_action(state, subindex)
120 if index < goal then
121 high = middle - 1
122 else if index > goal then
123 low = middle + 1
124 else
125 action_type = parser_action(state, subindex+1)
126 action_value = parser_action(state, subindex+2)
127 break
128 end
129 end
130
131 if action_type == 0 then # SHIFT
132 push(action_value, lexer.next)
133 else if action_type == 1 then # REDUCE
134 _reduce_table[action_value].action(self)
135 else if action_type == 2 then # ACCEPT
136 var node2 = lexer.next
137 assert node2 isa EOF
138 var node1 = pop
139 assert node1 isa AListing
140 var node = new Start(node1, node2)
141 (new ComputeProdLocationVisitor).enter_visit(node)
142 return node
143 else if action_type == 3 then # ERROR
144 var node2 = new AError.init_error("Syntax error: unexpected {token}.", token.location)
145 var node = new Start(null, node2)
146 return node
147 end
148 end
149 end
150
151 private var reduce_table: Array[ReduceAction]
152 private fun build_reduce_table
153 do
154 reduce_table = new Array[ReduceAction].with_items(
155 new ReduceAction0(0),
156 new ReduceAction1(0),
157 new ReduceAction2(0),
158 new ReduceAction3(0),
159 new ReduceAction4(1),
160 new ReduceAction5(1),
161 new ReduceAction6(1),
162 new ReduceAction7(1),
163 new ReduceAction8(1),
164 new ReduceAction9(1),
165 new ReduceAction10(1),
166 new ReduceAction11(1),
167 new ReduceAction12(1),
168 new ReduceAction13(1),
169 new ReduceAction14(1),
170 new ReduceAction15(1),
171 new ReduceAction16(2),
172 new ReduceAction17(3),
173 new ReduceAction18(3),
174 new ReduceAction19(4),
175 new ReduceAction20(4),
176 new ReduceAction21(5),
177 new ReduceAction22(5),
178 new ReduceAction23(5),
179 new ReduceAction24(5),
180 new ReduceAction25(5),
181 new ReduceAction26(6),
182 new ReduceAction27(6),
183 new ReduceAction28(6),
184 new ReduceAction29(6),
185 new ReduceAction30(6),
186 new ReduceAction31(6),
187 new ReduceAction32(6),
188 new ReduceAction33(7),
189 new ReduceAction34(7)
190 )
191 end
192 end
193
194 redef class Prod
195 # Location on the first token after the start of a production
196 # So outside the production for epilon production
197 var first_location: nullable Location
198
199 # Location of the last token before the end of a production
200 # So outside the production for epilon production
201 var last_location: nullable Location
202 end
203
204 # Find location of production nodes
205 # Uses existing token locations to infer location of productions.
206 private class ComputeProdLocationVisitor
207 super Visitor
208 # Currenlty visited productions that need a first token
209 var need_first_prods: Array[Prod] = new Array[Prod]
210
211 # Already visited epsilon productions that waits something after them
212 var need_after_epsilons: Array[Prod] = new Array[Prod]
213
214 # Already visited epsilon production that waits something before them
215 var need_before_epsilons: Array[Prod] = new Array[Prod]
216
217 # Location of the last visited token in the current production
218 var last_location: nullable Location = null
219
220 redef fun visit(n: nullable ANode)
221 do
222 if n == null then
223 return
224 else if n isa Token then
225 var loc = n.location
226 _last_location = loc
227
228 # Add a first token to productions that need one
229 if not _need_first_prods.is_empty then
230 for no in _need_first_prods do
231 no._first_location = loc
232 end
233 _need_first_prods.clear
234 end
235
236 # Find location for already visited epsilon production that need one
237 if not _need_after_epsilons.is_empty then
238 for no in _need_after_epsilons do
239 # Epsilon production that is in the middle of a non-epsilon production
240 # The epsilon production has both a token before and after it
241 var endl = loc
242 var startl = no._last_location
243 no.location = new Location(endl.file, startl.line_end, endl.line_start, startl.column_end, endl.column_start)
244 end
245 _need_after_epsilons.clear
246 end
247 else
248 assert n isa Prod
249 _need_first_prods.add(n)
250
251 var old_last = _last_location
252 _last_location = null
253 n.visit_all(self)
254 var endl = _last_location
255 if endl == null then _last_location = old_last
256
257 n._last_location = endl
258 var startl = n._first_location
259 if startl != null then
260 # Non-epsilon production
261 assert endl != null
262
263 n.location = new Location(startl.file, startl.line_start, endl.line_end, startl.column_start, endl.column_end)
264
265 if not _need_before_epsilons.is_empty then
266 var loc = new Location(startl.file, startl.line_start, startl.line_start, startl.column_start, startl.column_start)
267 for no in _need_before_epsilons do
268 # Epsilon production that starts the current non-epsilon production
269 no.location = loc
270 end
271 _need_before_epsilons.clear
272 end
273
274 if not _need_after_epsilons.is_empty then
275 var loc = new Location(endl.file, endl.line_end, endl.line_end, endl.column_end, endl.column_end)
276 for no in _need_after_epsilons do
277 # Epsilon production that finishes the current non-epsilon production
278 no.location = loc
279 end
280 _need_after_epsilons.clear
281 end
282 else
283 # No first token means epsilon production (or "throw all my tokens" production)
284 # So, it must be located it later
285 if endl == null then
286 # Epsilon production that starts a parent non-epsilon production
287 _need_before_epsilons.add(n)
288 else
289 # Epsilon production in the middle or that finishes a parent non-epsilon production
290 _need_after_epsilons.add(n)
291 end
292 end
293 end
294 end
295 end
296
297 # Each reduca action has its own class, this one is the root of the hierarchy.
298 private abstract class ReduceAction
299 fun action(p: Parser) is abstract
300 fun concat(l1, l2 : Array[Object]): Array[Object]
301 do
302 if l1.is_empty then return l2
303 l1.append(l2)
304 return l1
305 end
306 var goto: Int
307 init(g: Int) do _goto = g
308 end
309
310 private class ReduceAction0
311 super ReduceAction
312 redef fun action(p: Parser)
313 do
314 var node_list: nullable Object = null
315 var nodearraylist1 = p.pop
316 var listnode2 = new Array[Object]
317 var tendblocknode4 = nodearraylist1
318 assert tendblocknode4 isa nullable TEndBlock
319 var plistingnode1: nullable AListing = new AListing.init_alisting(
320 listnode2,
321 null,
322 tendblocknode4
323 )
324 node_list = plistingnode1
325 p.push(p.go_to(_goto), node_list)
326 end
327 end
328 private class ReduceAction1
329 super ReduceAction
330 redef fun action(p: Parser)
331 do
332 var node_list: nullable Object = null
333 var nodearraylist2 = p.pop
334 var nodearraylist1 = p.pop
335 var listnode3 = new Array[Object]
336 var listnode2 = nodearraylist1
337 assert listnode2 isa Array[Object]
338 listnode3 = concat(listnode3, listnode2)
339 var tendblocknode5 = nodearraylist2
340 assert tendblocknode5 isa nullable TEndBlock
341 var plistingnode1: nullable AListing = new AListing.init_alisting(
342 listnode3,
343 null,
344 tendblocknode5
345 )
346 node_list = plistingnode1
347 p.push(p.go_to(_goto), node_list)
348 end
349 end
350 private class ReduceAction2
351 super ReduceAction
352 redef fun action(p: Parser)
353 do
354 var node_list: nullable Object = null
355 var nodearraylist2 = p.pop
356 var nodearraylist1 = p.pop
357 var listnode2 = new Array[Object]
358 var plabeldeclnode3 = nodearraylist1
359 assert plabeldeclnode3 isa nullable ALabelDecl
360 var tendblocknode4 = nodearraylist2
361 assert tendblocknode4 isa nullable TEndBlock
362 var plistingnode1: nullable AListing = new AListing.init_alisting(
363 listnode2,
364 plabeldeclnode3,
365 tendblocknode4
366 )
367 node_list = plistingnode1
368 p.push(p.go_to(_goto), node_list)
369 end
370 end
371 private class ReduceAction3
372 super ReduceAction
373 redef fun action(p: Parser)
374 do
375 var node_list: nullable Object = null
376 var nodearraylist3 = p.pop
377 var nodearraylist2 = p.pop
378 var nodearraylist1 = p.pop
379 var listnode3 = new Array[Object]
380 var listnode2 = nodearraylist1
381 assert listnode2 isa Array[Object]
382 listnode3 = concat(listnode3, listnode2)
383 var plabeldeclnode4 = nodearraylist2
384 assert plabeldeclnode4 isa nullable ALabelDecl
385 var tendblocknode5 = nodearraylist3
386 assert tendblocknode5 isa nullable TEndBlock
387 var plistingnode1: nullable AListing = new AListing.init_alisting(
388 listnode3,
389 plabeldeclnode4,
390 tendblocknode5
391 )
392 node_list = plistingnode1
393 p.push(p.go_to(_goto), node_list)
394 end
395 end
396 private class ReduceAction4
397 super ReduceAction
398 redef fun action(p: Parser)
399 do
400 var node_list: nullable Object = null
401 var nodearraylist1 = p.pop
402 var teolnode4 = nodearraylist1
403 assert teolnode4 isa nullable TEol
404 var plinenode1: nullable AEmptyLine = new AEmptyLine.init_aemptyline(
405 null,
406 null,
407 teolnode4
408 )
409 node_list = plinenode1
410 p.push(p.go_to(_goto), node_list)
411 end
412 end
413 private class ReduceAction5
414 super ReduceAction
415 redef fun action(p: Parser)
416 do
417 var node_list: nullable Object = null
418 var nodearraylist2 = p.pop
419 var nodearraylist1 = p.pop
420 var plabeldeclnode2 = nodearraylist1
421 assert plabeldeclnode2 isa nullable ALabelDecl
422 var teolnode4 = nodearraylist2
423 assert teolnode4 isa nullable TEol
424 var plinenode1: nullable AEmptyLine = new AEmptyLine.init_aemptyline(
425 plabeldeclnode2,
426 null,
427 teolnode4
428 )
429 node_list = plinenode1
430 p.push(p.go_to(_goto), node_list)
431 end
432 end
433 private class ReduceAction6
434 super ReduceAction
435 redef fun action(p: Parser)
436 do
437 var node_list: nullable Object = null
438 var nodearraylist2 = p.pop
439 var nodearraylist1 = p.pop
440 var tcommentnode3 = nodearraylist1
441 assert tcommentnode3 isa nullable TComment
442 var teolnode4 = nodearraylist2
443 assert teolnode4 isa nullable TEol
444 var plinenode1: nullable AEmptyLine = new AEmptyLine.init_aemptyline(
445 null,
446 tcommentnode3,
447 teolnode4
448 )
449 node_list = plinenode1
450 p.push(p.go_to(_goto), node_list)
451 end
452 end
453 private class ReduceAction7
454 super ReduceAction
455 redef fun action(p: Parser)
456 do
457 var node_list: nullable Object = null
458 var nodearraylist3 = p.pop
459 var nodearraylist2 = p.pop
460 var nodearraylist1 = p.pop
461 var plabeldeclnode2 = nodearraylist1
462 assert plabeldeclnode2 isa nullable ALabelDecl
463 var tcommentnode3 = nodearraylist2
464 assert tcommentnode3 isa nullable TComment
465 var teolnode4 = nodearraylist3
466 assert teolnode4 isa nullable TEol
467 var plinenode1: nullable AEmptyLine = new AEmptyLine.init_aemptyline(
468 plabeldeclnode2,
469 tcommentnode3,
470 teolnode4
471 )
472 node_list = plinenode1
473 p.push(p.go_to(_goto), node_list)
474 end
475 end
476 private class ReduceAction8
477 super ReduceAction
478 redef fun action(p: Parser)
479 do
480 var node_list: nullable Object = null
481 var nodearraylist2 = p.pop
482 var nodearraylist1 = p.pop
483 var pinstructionnode3 = nodearraylist1
484 assert pinstructionnode3 isa nullable AInstruction
485 var teolnode5 = nodearraylist2
486 assert teolnode5 isa nullable TEol
487 var plinenode1: nullable AInstructionLine = new AInstructionLine.init_ainstructionline(
488 null,
489 pinstructionnode3,
490 null,
491 teolnode5
492 )
493 node_list = plinenode1
494 p.push(p.go_to(_goto), node_list)
495 end
496 end
497 private class ReduceAction9
498 super ReduceAction
499 redef fun action(p: Parser)
500 do
501 var node_list: nullable Object = null
502 var nodearraylist3 = p.pop
503 var nodearraylist2 = p.pop
504 var nodearraylist1 = p.pop
505 var plabeldeclnode2 = nodearraylist1
506 assert plabeldeclnode2 isa nullable ALabelDecl
507 var pinstructionnode3 = nodearraylist2
508 assert pinstructionnode3 isa nullable AInstruction
509 var teolnode5 = nodearraylist3
510 assert teolnode5 isa nullable TEol
511 var plinenode1: nullable AInstructionLine = new AInstructionLine.init_ainstructionline(
512 plabeldeclnode2,
513 pinstructionnode3,
514 null,
515 teolnode5
516 )
517 node_list = plinenode1
518 p.push(p.go_to(_goto), node_list)
519 end
520 end
521 private class ReduceAction10
522 super ReduceAction
523 redef fun action(p: Parser)
524 do
525 var node_list: nullable Object = null
526 var nodearraylist3 = p.pop
527 var nodearraylist2 = p.pop
528 var nodearraylist1 = p.pop
529 var pinstructionnode3 = nodearraylist1
530 assert pinstructionnode3 isa nullable AInstruction
531 var tcommentnode4 = nodearraylist2
532 assert tcommentnode4 isa nullable TComment
533 var teolnode5 = nodearraylist3
534 assert teolnode5 isa nullable TEol
535 var plinenode1: nullable AInstructionLine = new AInstructionLine.init_ainstructionline(
536 null,
537 pinstructionnode3,
538 tcommentnode4,
539 teolnode5
540 )
541 node_list = plinenode1
542 p.push(p.go_to(_goto), node_list)
543 end
544 end
545 private class ReduceAction11
546 super ReduceAction
547 redef fun action(p: Parser)
548 do
549 var node_list: nullable Object = null
550 var nodearraylist4 = p.pop
551 var nodearraylist3 = p.pop
552 var nodearraylist2 = p.pop
553 var nodearraylist1 = p.pop
554 var plabeldeclnode2 = nodearraylist1
555 assert plabeldeclnode2 isa nullable ALabelDecl
556 var pinstructionnode3 = nodearraylist2
557 assert pinstructionnode3 isa nullable AInstruction
558 var tcommentnode4 = nodearraylist3
559 assert tcommentnode4 isa nullable TComment
560 var teolnode5 = nodearraylist4
561 assert teolnode5 isa nullable TEol
562 var plinenode1: nullable AInstructionLine = new AInstructionLine.init_ainstructionline(
563 plabeldeclnode2,
564 pinstructionnode3,
565 tcommentnode4,
566 teolnode5
567 )
568 node_list = plinenode1
569 p.push(p.go_to(_goto), node_list)
570 end
571 end
572 private class ReduceAction12
573 super ReduceAction
574 redef fun action(p: Parser)
575 do
576 var node_list: nullable Object = null
577 var nodearraylist2 = p.pop
578 var nodearraylist1 = p.pop
579 var pdirectivenode3 = nodearraylist1
580 assert pdirectivenode3 isa nullable ADirective
581 var teolnode5 = nodearraylist2
582 assert teolnode5 isa nullable TEol
583 var plinenode1: nullable ADirectiveLine = new ADirectiveLine.init_adirectiveline(
584 null,
585 pdirectivenode3,
586 null,
587 teolnode5
588 )
589 node_list = plinenode1
590 p.push(p.go_to(_goto), node_list)
591 end
592 end
593 private class ReduceAction13
594 super ReduceAction
595 redef fun action(p: Parser)
596 do
597 var node_list: nullable Object = null
598 var nodearraylist3 = p.pop
599 var nodearraylist2 = p.pop
600 var nodearraylist1 = p.pop
601 var plabeldeclnode2 = nodearraylist1
602 assert plabeldeclnode2 isa nullable ALabelDecl
603 var pdirectivenode3 = nodearraylist2
604 assert pdirectivenode3 isa nullable ADirective
605 var teolnode5 = nodearraylist3
606 assert teolnode5 isa nullable TEol
607 var plinenode1: nullable ADirectiveLine = new ADirectiveLine.init_adirectiveline(
608 plabeldeclnode2,
609 pdirectivenode3,
610 null,
611 teolnode5
612 )
613 node_list = plinenode1
614 p.push(p.go_to(_goto), node_list)
615 end
616 end
617 private class ReduceAction14
618 super ReduceAction
619 redef fun action(p: Parser)
620 do
621 var node_list: nullable Object = null
622 var nodearraylist3 = p.pop
623 var nodearraylist2 = p.pop
624 var nodearraylist1 = p.pop
625 var pdirectivenode3 = nodearraylist1
626 assert pdirectivenode3 isa nullable ADirective
627 var tcommentnode4 = nodearraylist2
628 assert tcommentnode4 isa nullable TComment
629 var teolnode5 = nodearraylist3
630 assert teolnode5 isa nullable TEol
631 var plinenode1: nullable ADirectiveLine = new ADirectiveLine.init_adirectiveline(
632 null,
633 pdirectivenode3,
634 tcommentnode4,
635 teolnode5
636 )
637 node_list = plinenode1
638 p.push(p.go_to(_goto), node_list)
639 end
640 end
641 private class ReduceAction15
642 super ReduceAction
643 redef fun action(p: Parser)
644 do
645 var node_list: nullable Object = null
646 var nodearraylist4 = p.pop
647 var nodearraylist3 = p.pop
648 var nodearraylist2 = p.pop
649 var nodearraylist1 = p.pop
650 var plabeldeclnode2 = nodearraylist1
651 assert plabeldeclnode2 isa nullable ALabelDecl
652 var pdirectivenode3 = nodearraylist2
653 assert pdirectivenode3 isa nullable ADirective
654 var tcommentnode4 = nodearraylist3
655 assert tcommentnode4 isa nullable TComment
656 var teolnode5 = nodearraylist4
657 assert teolnode5 isa nullable TEol
658 var plinenode1: nullable ADirectiveLine = new ADirectiveLine.init_adirectiveline(
659 plabeldeclnode2,
660 pdirectivenode3,
661 tcommentnode4,
662 teolnode5
663 )
664 node_list = plinenode1
665 p.push(p.go_to(_goto), node_list)
666 end
667 end
668 private class ReduceAction16
669 super ReduceAction
670 redef fun action(p: Parser)
671 do
672 var node_list: nullable Object = null
673 var nodearraylist2 = p.pop
674 var nodearraylist1 = p.pop
675 var tidnode2 = nodearraylist1
676 assert tidnode2 isa nullable TId
677 var tcolonnode3 = nodearraylist2
678 assert tcolonnode3 isa nullable TColon
679 var plabeldeclnode1: nullable ALabelDecl = new ALabelDecl.init_alabeldecl(
680 tidnode2,
681 tcolonnode3
682 )
683 node_list = plabeldeclnode1
684 p.push(p.go_to(_goto), node_list)
685 end
686 end
687 private class ReduceAction17
688 super ReduceAction
689 redef fun action(p: Parser)
690 do
691 var node_list: nullable Object = null
692 var nodearraylist1 = p.pop
693 var tidnode2 = nodearraylist1
694 assert tidnode2 isa nullable TId
695 var pinstructionnode1: nullable AUnaryInstruction = new AUnaryInstruction.init_aunaryinstruction(
696 tidnode2
697 )
698 node_list = pinstructionnode1
699 p.push(p.go_to(_goto), node_list)
700 end
701 end
702 private class ReduceAction18
703 super ReduceAction
704 redef fun action(p: Parser)
705 do
706 var node_list: nullable Object = null
707 var nodearraylist2 = p.pop
708 var nodearraylist1 = p.pop
709 var tidnode2 = nodearraylist1
710 assert tidnode2 isa nullable TId
711 var poperandnode3 = nodearraylist2
712 assert poperandnode3 isa nullable AOperand
713 var pinstructionnode1: nullable ABinaryInstruction = new ABinaryInstruction.init_abinaryinstruction(
714 tidnode2,
715 poperandnode3
716 )
717 node_list = pinstructionnode1
718 p.push(p.go_to(_goto), node_list)
719 end
720 end
721 private class ReduceAction19
722 super ReduceAction
723 redef fun action(p: Parser)
724 do
725 var node_list: nullable Object = null
726 var nodearraylist1 = p.pop
727 var pvaluenode2 = nodearraylist1
728 assert pvaluenode2 isa nullable AValue
729 var poperandnode1: nullable AImmediateOperand = new AImmediateOperand.init_aimmediateoperand(
730 pvaluenode2
731 )
732 node_list = poperandnode1
733 p.push(p.go_to(_goto), node_list)
734 end
735 end
736 private class ReduceAction20
737 super ReduceAction
738 redef fun action(p: Parser)
739 do
740 var node_list: nullable Object = null
741 var nodearraylist3 = p.pop
742 var nodearraylist2 = p.pop
743 var nodearraylist1 = p.pop
744 var pvaluenode2 = nodearraylist1
745 assert pvaluenode2 isa nullable AValue
746 var tcommanode3 = nodearraylist2
747 assert tcommanode3 isa nullable TComma
748 var tidnode4 = nodearraylist3
749 assert tidnode4 isa nullable TId
750 var poperandnode1: nullable AAnyOperand = new AAnyOperand.init_aanyoperand(
751 pvaluenode2,
752 tcommanode3,
753 tidnode4
754 )
755 node_list = poperandnode1
756 p.push(p.go_to(_goto), node_list)
757 end
758 end
759 private class ReduceAction21
760 super ReduceAction
761 redef fun action(p: Parser)
762 do
763 var node_list: nullable Object = null
764 var nodearraylist1 = p.pop
765 var tidnode2 = nodearraylist1
766 assert tidnode2 isa nullable TId
767 var pvaluenode1: nullable ALabelValue = new ALabelValue.init_alabelvalue(
768 tidnode2
769 )
770 node_list = pvaluenode1
771 p.push(p.go_to(_goto), node_list)
772 end
773 end
774 private class ReduceAction22
775 super ReduceAction
776 redef fun action(p: Parser)
777 do
778 var node_list: nullable Object = null
779 var nodearraylist1 = p.pop
780 var tnumbernode2 = nodearraylist1
781 assert tnumbernode2 isa nullable TNumber
782 var pvaluenode1: nullable ANumberValue = new ANumberValue.init_anumbervalue(
783 tnumbernode2
784 )
785 node_list = pvaluenode1
786 p.push(p.go_to(_goto), node_list)
787 end
788 end
789 private class ReduceAction23
790 super ReduceAction
791 redef fun action(p: Parser)
792 do
793 var node_list: nullable Object = null
794 var nodearraylist1 = p.pop
795 var tcharnode2 = nodearraylist1
796 assert tcharnode2 isa nullable TChar
797 var pvaluenode1: nullable ACharValue = new ACharValue.init_acharvalue(
798 tcharnode2
799 )
800 node_list = pvaluenode1
801 p.push(p.go_to(_goto), node_list)
802 end
803 end
804 private class ReduceAction24
805 super ReduceAction
806 redef fun action(p: Parser)
807 do
808 var node_list: nullable Object = null
809 var nodearraylist1 = p.pop
810 var tstringnode2 = nodearraylist1
811 assert tstringnode2 isa nullable TString
812 var pvaluenode1: nullable AStringValue = new AStringValue.init_astringvalue(
813 tstringnode2
814 )
815 node_list = pvaluenode1
816 p.push(p.go_to(_goto), node_list)
817 end
818 end
819 private class ReduceAction25
820 super ReduceAction
821 redef fun action(p: Parser)
822 do
823 var node_list: nullable Object = null
824 var nodearraylist1 = p.pop
825 var thexnode2 = nodearraylist1
826 assert thexnode2 isa nullable THex
827 var pvaluenode1: nullable AHexValue = new AHexValue.init_ahexvalue(
828 thexnode2
829 )
830 node_list = pvaluenode1
831 p.push(p.go_to(_goto), node_list)
832 end
833 end
834 private class ReduceAction26
835 super ReduceAction
836 redef fun action(p: Parser)
837 do
838 var node_list: nullable Object = null
839 var nodearraylist2 = p.pop
840 var nodearraylist1 = p.pop
841 var ttkbytenode2 = nodearraylist1
842 assert ttkbytenode2 isa nullable TTkByte
843 var pvaluenode3 = nodearraylist2
844 assert pvaluenode3 isa nullable AValue
845 var pdirectivenode1: nullable AByteDirective = new AByteDirective.init_abytedirective(
846 ttkbytenode2,
847 pvaluenode3
848 )
849 node_list = pdirectivenode1
850 p.push(p.go_to(_goto), node_list)
851 end
852 end
853 private class ReduceAction27
854 super ReduceAction
855 redef fun action(p: Parser)
856 do
857 var node_list: nullable Object = null
858 var nodearraylist2 = p.pop
859 var nodearraylist1 = p.pop
860 var ttkwordnode2 = nodearraylist1
861 assert ttkwordnode2 isa nullable TTkWord
862 var pvaluenode3 = nodearraylist2
863 assert pvaluenode3 isa nullable AValue
864 var pdirectivenode1: nullable AWordDirective = new AWordDirective.init_aworddirective(
865 ttkwordnode2,
866 pvaluenode3
867 )
868 node_list = pdirectivenode1
869 p.push(p.go_to(_goto), node_list)
870 end
871 end
872 private class ReduceAction28
873 super ReduceAction
874 redef fun action(p: Parser)
875 do
876 var node_list: nullable Object = null
877 var nodearraylist2 = p.pop
878 var nodearraylist1 = p.pop
879 var ttkblocknode2 = nodearraylist1
880 assert ttkblocknode2 isa nullable TTkBlock
881 var pvaluenode3 = nodearraylist2
882 assert pvaluenode3 isa nullable AValue
883 var pdirectivenode1: nullable ABlockDirective = new ABlockDirective.init_ablockdirective(
884 ttkblocknode2,
885 pvaluenode3
886 )
887 node_list = pdirectivenode1
888 p.push(p.go_to(_goto), node_list)
889 end
890 end
891 private class ReduceAction29
892 super ReduceAction
893 redef fun action(p: Parser)
894 do
895 var node_list: nullable Object = null
896 var nodearraylist2 = p.pop
897 var nodearraylist1 = p.pop
898 var ttkasciinode2 = nodearraylist1
899 assert ttkasciinode2 isa nullable TTkAscii
900 var pvaluenode3 = nodearraylist2
901 assert pvaluenode3 isa nullable AValue
902 var pdirectivenode1: nullable AAsciiDirective = new AAsciiDirective.init_aasciidirective(
903 ttkasciinode2,
904 pvaluenode3
905 )
906 node_list = pdirectivenode1
907 p.push(p.go_to(_goto), node_list)
908 end
909 end
910 private class ReduceAction30
911 super ReduceAction
912 redef fun action(p: Parser)
913 do
914 var node_list: nullable Object = null
915 var nodearraylist2 = p.pop
916 var nodearraylist1 = p.pop
917 var ttkaddrssnode2 = nodearraylist1
918 assert ttkaddrssnode2 isa nullable TTkAddrss
919 var pvaluenode3 = nodearraylist2
920 assert pvaluenode3 isa nullable AValue
921 var pdirectivenode1: nullable AAddrssDirective = new AAddrssDirective.init_aaddrssdirective(
922 ttkaddrssnode2,
923 pvaluenode3
924 )
925 node_list = pdirectivenode1
926 p.push(p.go_to(_goto), node_list)
927 end
928 end
929 private class ReduceAction31
930 super ReduceAction
931 redef fun action(p: Parser)
932 do
933 var node_list: nullable Object = null
934 var nodearraylist2 = p.pop
935 var nodearraylist1 = p.pop
936 var ttkequatenode2 = nodearraylist1
937 assert ttkequatenode2 isa nullable TTkEquate
938 var pvaluenode3 = nodearraylist2
939 assert pvaluenode3 isa nullable AValue
940 var pdirectivenode1: nullable AEquateDirective = new AEquateDirective.init_aequatedirective(
941 ttkequatenode2,
942 pvaluenode3
943 )
944 node_list = pdirectivenode1
945 p.push(p.go_to(_goto), node_list)
946 end
947 end
948 private class ReduceAction32
949 super ReduceAction
950 redef fun action(p: Parser)
951 do
952 var node_list: nullable Object = null
953 var nodearraylist2 = p.pop
954 var nodearraylist1 = p.pop
955 var ttkburnnode2 = nodearraylist1
956 assert ttkburnnode2 isa nullable TTkBurn
957 var pvaluenode3 = nodearraylist2
958 assert pvaluenode3 isa nullable AValue
959 var pdirectivenode1: nullable ABurnDirective = new ABurnDirective.init_aburndirective(
960 ttkburnnode2,
961 pvaluenode3
962 )
963 node_list = pdirectivenode1
964 p.push(p.go_to(_goto), node_list)
965 end
966 end
967 private class ReduceAction33
968 super ReduceAction
969 redef fun action(p: Parser)
970 do
971 var node_list: nullable Object = null
972 var nodearraylist1 = p.pop
973 var listnode2 = new Array[Object]
974 var plinenode1 = nodearraylist1
975 if plinenode1 != null then
976 listnode2.add(plinenode1)
977 end
978 node_list = listnode2
979 p.push(p.go_to(_goto), node_list)
980 end
981 end
982 private class ReduceAction34
983 super ReduceAction
984 redef fun action(p: Parser)
985 do
986 var node_list: nullable Object = null
987 var nodearraylist2 = p.pop
988 var nodearraylist1 = p.pop
989 var listnode3 = new Array[Object]
990 var listnode1 = nodearraylist1
991 assert listnode1 isa Array[Object]
992 var plinenode2 = nodearraylist2
993 listnode3 = concat(listnode3, listnode1)
994 if plinenode2 != null then
995 listnode3.add(plinenode2)
996 end
997 node_list = listnode3
998 p.push(p.go_to(_goto), node_list)
999 end
1000 end