2 # This file was generated by SableCC (http://www.sablecc.org/).
5 intrude import parser_prod
8 # State of the parser automata as stored in the parser stack.
10 # The internal state number
13 # The node stored with the state in the stack
14 var nodes
: nullable Object
16 init(state
: Int, nodes
: nullable Object)
28 # Stack of pushed states and productions
29 private var stack
: Array[State]
31 # Position in the stack
32 private var stack_pos
: Int
34 # Create a new parser based on a given lexer
38 _stack
= new Array[State]
43 # Do a transition in the automata
44 private fun go_to
(index
: Int): Int
48 var high
= parser_goto
(index
, 0) - 1
51 var middle
= (low
+ high
) / 2
52 var subindex
= middle
* 2 + 1 # +1 because parser_goto(index, 0) is the length
54 var goal
= parser_goto
(index
, subindex
)
57 else if state
> goal
then
60 return parser_goto
(index
, subindex
+1)
64 return parser_goto
(index
, 2) # Default value
67 # Push someting in the state stack
68 private fun push
(numstate
: Int, list_node
: nullable Object)
70 var pos
= _stack_pos
+ 1
72 if pos
< _stack
.length
then
73 var state
= _stack
[pos
]
74 state
.state
= numstate
75 state
.nodes
= list_node
77 _stack
.push
(new State(numstate
, list_node
))
82 private fun state
: Int
84 return _stack
[_stack_pos
].state
87 # Pop something from the stack state
88 private fun pop
: nullable Object
90 var res
= _stack
[_stack_pos
].nodes
91 _stack_pos
= _stack_pos
-1
95 # Build and return a full AST.
102 var token
= lexer
.peek
103 if token
isa AError then
104 return new Start(null, token
)
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)
113 var high
= parser_action
(state
, 0) - 1
116 var middle
= (low
+ high
) / 2
117 var subindex
= middle
* 3 + 1 # +1 because parser_action(state, 0) is the length
119 var goal
= parser_action
(state
, subindex
)
122 else if index
> goal
then
125 action_type
= parser_action
(state
, subindex
+1)
126 action_value
= parser_action
(state
, subindex
+2)
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
139 assert node1
isa AListing
140 var node
= new Start(node1
, node2
)
141 (new ComputeProdLocationVisitor).enter_visit
(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
)
151 private var reduce_table
: Array[ReduceAction]
152 private fun build_reduce_table
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)
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
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
204 # Find location of production nodes
205 # Uses existing token locations to infer location of productions.
206 private class ComputeProdLocationVisitor
208 # Currenlty visited productions that need a first token
209 var need_first_prods
: Array[Prod] = new Array[Prod]
211 # Already visited epsilon productions that waits something after them
212 var need_after_epsilons
: Array[Prod] = new Array[Prod]
214 # Already visited epsilon production that waits something before them
215 var need_before_epsilons
: Array[Prod] = new Array[Prod]
217 # Location of the last visited token in the current production
218 var last_location
: nullable Location = null
220 redef fun visit
(n
: nullable ANode)
224 else if n
isa Token then
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
233 _need_first_prods
.clear
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
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
)
245 _need_after_epsilons
.clear
249 _need_first_prods
.add
(n
)
251 var old_last
= _last_location
252 _last_location
= null
254 var endl
= _last_location
255 if endl
== null then _last_location
= old_last
257 n
._last_location
= endl
258 var startl
= n
._first_location
259 if startl
!= null then
260 # Non-epsilon production
263 n
.location
= new Location(startl
.file
, startl
.line_start
, endl
.line_end
, startl
.column_start
, endl
.column_end
)
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
271 _need_before_epsilons
.clear
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
280 _need_after_epsilons
.clear
283 # No first token means epsilon production (or "throw all my tokens" production)
284 # So, it must be located it later
286 # Epsilon production that starts a parent non-epsilon production
287 _need_before_epsilons
.add
(n
)
289 # Epsilon production in the middle or that finishes a parent non-epsilon production
290 _need_after_epsilons
.add
(n
)
299 # Each reduca action has its own class, this one is the root of the hierarchy.
300 private abstract class ReduceAction
301 fun action
(p
: Parser) is abstract
302 fun concat
(l1
, l2
: Array[Object]): Array[Object]
304 if l1
.is_empty
then return l2
309 init(g
: Int) do _goto
= g
312 private class ReduceAction0
314 redef fun action
(p
: Parser)
316 var node_list
: nullable Object = null
317 var nodearraylist1
= p
.pop
318 var listnode2
= new Array[Object]
319 var tendblocknode4
= nodearraylist1
320 assert tendblocknode4
isa nullable TEndBlock
321 var plistingnode1
: nullable AListing = new AListing.init_alisting
(
326 node_list
= plistingnode1
327 p
.push
(p
.go_to
(_goto
), node_list
)
330 private class ReduceAction1
332 redef fun action
(p
: Parser)
334 var node_list
: nullable Object = null
335 var nodearraylist2
= p
.pop
336 var nodearraylist1
= p
.pop
337 var listnode3
= new Array[Object]
338 var listnode2
= nodearraylist1
339 assert listnode2
isa Array[Object]
340 listnode3
= concat
(listnode3
, listnode2
)
341 var tendblocknode5
= nodearraylist2
342 assert tendblocknode5
isa nullable TEndBlock
343 var plistingnode1
: nullable AListing = new AListing.init_alisting
(
348 node_list
= plistingnode1
349 p
.push
(p
.go_to
(_goto
), node_list
)
352 private class ReduceAction2
354 redef fun action
(p
: Parser)
356 var node_list
: nullable Object = null
357 var nodearraylist2
= p
.pop
358 var nodearraylist1
= p
.pop
359 var listnode2
= new Array[Object]
360 var plabeldeclnode3
= nodearraylist1
361 assert plabeldeclnode3
isa nullable ALabelDecl
362 var tendblocknode4
= nodearraylist2
363 assert tendblocknode4
isa nullable TEndBlock
364 var plistingnode1
: nullable AListing = new AListing.init_alisting
(
369 node_list
= plistingnode1
370 p
.push
(p
.go_to
(_goto
), node_list
)
373 private class ReduceAction3
375 redef fun action
(p
: Parser)
377 var node_list
: nullable Object = null
378 var nodearraylist3
= p
.pop
379 var nodearraylist2
= p
.pop
380 var nodearraylist1
= p
.pop
381 var listnode3
= new Array[Object]
382 var listnode2
= nodearraylist1
383 assert listnode2
isa Array[Object]
384 listnode3
= concat
(listnode3
, listnode2
)
385 var plabeldeclnode4
= nodearraylist2
386 assert plabeldeclnode4
isa nullable ALabelDecl
387 var tendblocknode5
= nodearraylist3
388 assert tendblocknode5
isa nullable TEndBlock
389 var plistingnode1
: nullable AListing = new AListing.init_alisting
(
394 node_list
= plistingnode1
395 p
.push
(p
.go_to
(_goto
), node_list
)
398 private class ReduceAction4
400 redef fun action
(p
: Parser)
402 var node_list
: nullable Object = null
403 var nodearraylist1
= p
.pop
404 var teolnode4
= nodearraylist1
405 assert teolnode4
isa nullable TEol
406 var plinenode1
: nullable AEmptyLine = new AEmptyLine.init_aemptyline
(
411 node_list
= plinenode1
412 p
.push
(p
.go_to
(_goto
), node_list
)
415 private class ReduceAction5
417 redef fun action
(p
: Parser)
419 var node_list
: nullable Object = null
420 var nodearraylist2
= p
.pop
421 var nodearraylist1
= p
.pop
422 var plabeldeclnode2
= nodearraylist1
423 assert plabeldeclnode2
isa nullable ALabelDecl
424 var teolnode4
= nodearraylist2
425 assert teolnode4
isa nullable TEol
426 var plinenode1
: nullable AEmptyLine = new AEmptyLine.init_aemptyline
(
431 node_list
= plinenode1
432 p
.push
(p
.go_to
(_goto
), node_list
)
435 private class ReduceAction6
437 redef fun action
(p
: Parser)
439 var node_list
: nullable Object = null
440 var nodearraylist2
= p
.pop
441 var nodearraylist1
= p
.pop
442 var tcommentnode3
= nodearraylist1
443 assert tcommentnode3
isa nullable TComment
444 var teolnode4
= nodearraylist2
445 assert teolnode4
isa nullable TEol
446 var plinenode1
: nullable AEmptyLine = new AEmptyLine.init_aemptyline
(
451 node_list
= plinenode1
452 p
.push
(p
.go_to
(_goto
), node_list
)
455 private class ReduceAction7
457 redef fun action
(p
: Parser)
459 var node_list
: nullable Object = null
460 var nodearraylist3
= p
.pop
461 var nodearraylist2
= p
.pop
462 var nodearraylist1
= p
.pop
463 var plabeldeclnode2
= nodearraylist1
464 assert plabeldeclnode2
isa nullable ALabelDecl
465 var tcommentnode3
= nodearraylist2
466 assert tcommentnode3
isa nullable TComment
467 var teolnode4
= nodearraylist3
468 assert teolnode4
isa nullable TEol
469 var plinenode1
: nullable AEmptyLine = new AEmptyLine.init_aemptyline
(
474 node_list
= plinenode1
475 p
.push
(p
.go_to
(_goto
), node_list
)
478 private class ReduceAction8
480 redef fun action
(p
: Parser)
482 var node_list
: nullable Object = null
483 var nodearraylist2
= p
.pop
484 var nodearraylist1
= p
.pop
485 var pinstructionnode3
= nodearraylist1
486 assert pinstructionnode3
isa nullable AInstruction
487 var teolnode5
= nodearraylist2
488 assert teolnode5
isa nullable TEol
489 var plinenode1
: nullable AInstructionLine = new AInstructionLine.init_ainstructionline
(
495 node_list
= plinenode1
496 p
.push
(p
.go_to
(_goto
), node_list
)
499 private class ReduceAction9
501 redef fun action
(p
: Parser)
503 var node_list
: nullable Object = null
504 var nodearraylist3
= p
.pop
505 var nodearraylist2
= p
.pop
506 var nodearraylist1
= p
.pop
507 var plabeldeclnode2
= nodearraylist1
508 assert plabeldeclnode2
isa nullable ALabelDecl
509 var pinstructionnode3
= nodearraylist2
510 assert pinstructionnode3
isa nullable AInstruction
511 var teolnode5
= nodearraylist3
512 assert teolnode5
isa nullable TEol
513 var plinenode1
: nullable AInstructionLine = new AInstructionLine.init_ainstructionline
(
519 node_list
= plinenode1
520 p
.push
(p
.go_to
(_goto
), node_list
)
523 private class ReduceAction10
525 redef fun action
(p
: Parser)
527 var node_list
: nullable Object = null
528 var nodearraylist3
= p
.pop
529 var nodearraylist2
= p
.pop
530 var nodearraylist1
= p
.pop
531 var pinstructionnode3
= nodearraylist1
532 assert pinstructionnode3
isa nullable AInstruction
533 var tcommentnode4
= nodearraylist2
534 assert tcommentnode4
isa nullable TComment
535 var teolnode5
= nodearraylist3
536 assert teolnode5
isa nullable TEol
537 var plinenode1
: nullable AInstructionLine = new AInstructionLine.init_ainstructionline
(
543 node_list
= plinenode1
544 p
.push
(p
.go_to
(_goto
), node_list
)
547 private class ReduceAction11
549 redef fun action
(p
: Parser)
551 var node_list
: nullable Object = null
552 var nodearraylist4
= p
.pop
553 var nodearraylist3
= p
.pop
554 var nodearraylist2
= p
.pop
555 var nodearraylist1
= p
.pop
556 var plabeldeclnode2
= nodearraylist1
557 assert plabeldeclnode2
isa nullable ALabelDecl
558 var pinstructionnode3
= nodearraylist2
559 assert pinstructionnode3
isa nullable AInstruction
560 var tcommentnode4
= nodearraylist3
561 assert tcommentnode4
isa nullable TComment
562 var teolnode5
= nodearraylist4
563 assert teolnode5
isa nullable TEol
564 var plinenode1
: nullable AInstructionLine = new AInstructionLine.init_ainstructionline
(
570 node_list
= plinenode1
571 p
.push
(p
.go_to
(_goto
), node_list
)
574 private class ReduceAction12
576 redef fun action
(p
: Parser)
578 var node_list
: nullable Object = null
579 var nodearraylist2
= p
.pop
580 var nodearraylist1
= p
.pop
581 var pdirectivenode3
= nodearraylist1
582 assert pdirectivenode3
isa nullable ADirective
583 var teolnode5
= nodearraylist2
584 assert teolnode5
isa nullable TEol
585 var plinenode1
: nullable ADirectiveLine = new ADirectiveLine.init_adirectiveline
(
591 node_list
= plinenode1
592 p
.push
(p
.go_to
(_goto
), node_list
)
595 private class ReduceAction13
597 redef fun action
(p
: Parser)
599 var node_list
: nullable Object = null
600 var nodearraylist3
= p
.pop
601 var nodearraylist2
= p
.pop
602 var nodearraylist1
= p
.pop
603 var plabeldeclnode2
= nodearraylist1
604 assert plabeldeclnode2
isa nullable ALabelDecl
605 var pdirectivenode3
= nodearraylist2
606 assert pdirectivenode3
isa nullable ADirective
607 var teolnode5
= nodearraylist3
608 assert teolnode5
isa nullable TEol
609 var plinenode1
: nullable ADirectiveLine = new ADirectiveLine.init_adirectiveline
(
615 node_list
= plinenode1
616 p
.push
(p
.go_to
(_goto
), node_list
)
619 private class ReduceAction14
621 redef fun action
(p
: Parser)
623 var node_list
: nullable Object = null
624 var nodearraylist3
= p
.pop
625 var nodearraylist2
= p
.pop
626 var nodearraylist1
= p
.pop
627 var pdirectivenode3
= nodearraylist1
628 assert pdirectivenode3
isa nullable ADirective
629 var tcommentnode4
= nodearraylist2
630 assert tcommentnode4
isa nullable TComment
631 var teolnode5
= nodearraylist3
632 assert teolnode5
isa nullable TEol
633 var plinenode1
: nullable ADirectiveLine = new ADirectiveLine.init_adirectiveline
(
639 node_list
= plinenode1
640 p
.push
(p
.go_to
(_goto
), node_list
)
643 private class ReduceAction15
645 redef fun action
(p
: Parser)
647 var node_list
: nullable Object = null
648 var nodearraylist4
= p
.pop
649 var nodearraylist3
= p
.pop
650 var nodearraylist2
= p
.pop
651 var nodearraylist1
= p
.pop
652 var plabeldeclnode2
= nodearraylist1
653 assert plabeldeclnode2
isa nullable ALabelDecl
654 var pdirectivenode3
= nodearraylist2
655 assert pdirectivenode3
isa nullable ADirective
656 var tcommentnode4
= nodearraylist3
657 assert tcommentnode4
isa nullable TComment
658 var teolnode5
= nodearraylist4
659 assert teolnode5
isa nullable TEol
660 var plinenode1
: nullable ADirectiveLine = new ADirectiveLine.init_adirectiveline
(
666 node_list
= plinenode1
667 p
.push
(p
.go_to
(_goto
), node_list
)
670 private class ReduceAction16
672 redef fun action
(p
: Parser)
674 var node_list
: nullable Object = null
675 var nodearraylist2
= p
.pop
676 var nodearraylist1
= p
.pop
677 var tidnode2
= nodearraylist1
678 assert tidnode2
isa nullable TId
679 var tcolonnode3
= nodearraylist2
680 assert tcolonnode3
isa nullable TColon
681 var plabeldeclnode1
: nullable ALabelDecl = new ALabelDecl.init_alabeldecl
(
685 node_list
= plabeldeclnode1
686 p
.push
(p
.go_to
(_goto
), node_list
)
689 private class ReduceAction17
691 redef fun action
(p
: Parser)
693 var node_list
: nullable Object = null
694 var nodearraylist1
= p
.pop
695 var tidnode2
= nodearraylist1
696 assert tidnode2
isa nullable TId
697 var pinstructionnode1
: nullable AUnaryInstruction = new AUnaryInstruction.init_aunaryinstruction
(
700 node_list
= pinstructionnode1
701 p
.push
(p
.go_to
(_goto
), node_list
)
704 private class ReduceAction18
706 redef fun action
(p
: Parser)
708 var node_list
: nullable Object = null
709 var nodearraylist2
= p
.pop
710 var nodearraylist1
= p
.pop
711 var tidnode2
= nodearraylist1
712 assert tidnode2
isa nullable TId
713 var poperandnode3
= nodearraylist2
714 assert poperandnode3
isa nullable AOperand
715 var pinstructionnode1
: nullable ABinaryInstruction = new ABinaryInstruction.init_abinaryinstruction
(
719 node_list
= pinstructionnode1
720 p
.push
(p
.go_to
(_goto
), node_list
)
723 private class ReduceAction19
725 redef fun action
(p
: Parser)
727 var node_list
: nullable Object = null
728 var nodearraylist1
= p
.pop
729 var pvaluenode2
= nodearraylist1
730 assert pvaluenode2
isa nullable AValue
731 var poperandnode1
: nullable AImmediateOperand = new AImmediateOperand.init_aimmediateoperand
(
734 node_list
= poperandnode1
735 p
.push
(p
.go_to
(_goto
), node_list
)
738 private class ReduceAction20
740 redef fun action
(p
: Parser)
742 var node_list
: nullable Object = null
743 var nodearraylist3
= p
.pop
744 var nodearraylist2
= p
.pop
745 var nodearraylist1
= p
.pop
746 var pvaluenode2
= nodearraylist1
747 assert pvaluenode2
isa nullable AValue
748 var tcommanode3
= nodearraylist2
749 assert tcommanode3
isa nullable TComma
750 var tidnode4
= nodearraylist3
751 assert tidnode4
isa nullable TId
752 var poperandnode1
: nullable AAnyOperand = new AAnyOperand.init_aanyoperand
(
757 node_list
= poperandnode1
758 p
.push
(p
.go_to
(_goto
), node_list
)
761 private class ReduceAction21
763 redef fun action
(p
: Parser)
765 var node_list
: nullable Object = null
766 var nodearraylist1
= p
.pop
767 var tidnode2
= nodearraylist1
768 assert tidnode2
isa nullable TId
769 var pvaluenode1
: nullable ALabelValue = new ALabelValue.init_alabelvalue
(
772 node_list
= pvaluenode1
773 p
.push
(p
.go_to
(_goto
), node_list
)
776 private class ReduceAction22
778 redef fun action
(p
: Parser)
780 var node_list
: nullable Object = null
781 var nodearraylist1
= p
.pop
782 var tnumbernode2
= nodearraylist1
783 assert tnumbernode2
isa nullable TNumber
784 var pvaluenode1
: nullable ANumberValue = new ANumberValue.init_anumbervalue
(
787 node_list
= pvaluenode1
788 p
.push
(p
.go_to
(_goto
), node_list
)
791 private class ReduceAction23
793 redef fun action
(p
: Parser)
795 var node_list
: nullable Object = null
796 var nodearraylist1
= p
.pop
797 var tcharnode2
= nodearraylist1
798 assert tcharnode2
isa nullable TChar
799 var pvaluenode1
: nullable ACharValue = new ACharValue.init_acharvalue
(
802 node_list
= pvaluenode1
803 p
.push
(p
.go_to
(_goto
), node_list
)
806 private class ReduceAction24
808 redef fun action
(p
: Parser)
810 var node_list
: nullable Object = null
811 var nodearraylist1
= p
.pop
812 var tstringnode2
= nodearraylist1
813 assert tstringnode2
isa nullable TString
814 var pvaluenode1
: nullable AStringValue = new AStringValue.init_astringvalue
(
817 node_list
= pvaluenode1
818 p
.push
(p
.go_to
(_goto
), node_list
)
821 private class ReduceAction25
823 redef fun action
(p
: Parser)
825 var node_list
: nullable Object = null
826 var nodearraylist1
= p
.pop
827 var thexnode2
= nodearraylist1
828 assert thexnode2
isa nullable THex
829 var pvaluenode1
: nullable AHexValue = new AHexValue.init_ahexvalue
(
832 node_list
= pvaluenode1
833 p
.push
(p
.go_to
(_goto
), node_list
)
836 private class ReduceAction26
838 redef fun action
(p
: Parser)
840 var node_list
: nullable Object = null
841 var nodearraylist2
= p
.pop
842 var nodearraylist1
= p
.pop
843 var ttkbytenode2
= nodearraylist1
844 assert ttkbytenode2
isa nullable TTkByte
845 var pvaluenode3
= nodearraylist2
846 assert pvaluenode3
isa nullable AValue
847 var pdirectivenode1
: nullable AByteDirective = new AByteDirective.init_abytedirective
(
851 node_list
= pdirectivenode1
852 p
.push
(p
.go_to
(_goto
), node_list
)
855 private class ReduceAction27
857 redef fun action
(p
: Parser)
859 var node_list
: nullable Object = null
860 var nodearraylist2
= p
.pop
861 var nodearraylist1
= p
.pop
862 var ttkwordnode2
= nodearraylist1
863 assert ttkwordnode2
isa nullable TTkWord
864 var pvaluenode3
= nodearraylist2
865 assert pvaluenode3
isa nullable AValue
866 var pdirectivenode1
: nullable AWordDirective = new AWordDirective.init_aworddirective
(
870 node_list
= pdirectivenode1
871 p
.push
(p
.go_to
(_goto
), node_list
)
874 private class ReduceAction28
876 redef fun action
(p
: Parser)
878 var node_list
: nullable Object = null
879 var nodearraylist2
= p
.pop
880 var nodearraylist1
= p
.pop
881 var ttkblocknode2
= nodearraylist1
882 assert ttkblocknode2
isa nullable TTkBlock
883 var pvaluenode3
= nodearraylist2
884 assert pvaluenode3
isa nullable AValue
885 var pdirectivenode1
: nullable ABlockDirective = new ABlockDirective.init_ablockdirective
(
889 node_list
= pdirectivenode1
890 p
.push
(p
.go_to
(_goto
), node_list
)
893 private class ReduceAction29
895 redef fun action
(p
: Parser)
897 var node_list
: nullable Object = null
898 var nodearraylist2
= p
.pop
899 var nodearraylist1
= p
.pop
900 var ttkasciinode2
= nodearraylist1
901 assert ttkasciinode2
isa nullable TTkAscii
902 var pvaluenode3
= nodearraylist2
903 assert pvaluenode3
isa nullable AValue
904 var pdirectivenode1
: nullable AAsciiDirective = new AAsciiDirective.init_aasciidirective
(
908 node_list
= pdirectivenode1
909 p
.push
(p
.go_to
(_goto
), node_list
)
912 private class ReduceAction30
914 redef fun action
(p
: Parser)
916 var node_list
: nullable Object = null
917 var nodearraylist2
= p
.pop
918 var nodearraylist1
= p
.pop
919 var ttkaddrssnode2
= nodearraylist1
920 assert ttkaddrssnode2
isa nullable TTkAddrss
921 var pvaluenode3
= nodearraylist2
922 assert pvaluenode3
isa nullable AValue
923 var pdirectivenode1
: nullable AAddrssDirective = new AAddrssDirective.init_aaddrssdirective
(
927 node_list
= pdirectivenode1
928 p
.push
(p
.go_to
(_goto
), node_list
)
931 private class ReduceAction31
933 redef fun action
(p
: Parser)
935 var node_list
: nullable Object = null
936 var nodearraylist2
= p
.pop
937 var nodearraylist1
= p
.pop
938 var ttkequatenode2
= nodearraylist1
939 assert ttkequatenode2
isa nullable TTkEquate
940 var pvaluenode3
= nodearraylist2
941 assert pvaluenode3
isa nullable AValue
942 var pdirectivenode1
: nullable AEquateDirective = new AEquateDirective.init_aequatedirective
(
946 node_list
= pdirectivenode1
947 p
.push
(p
.go_to
(_goto
), node_list
)
950 private class ReduceAction32
952 redef fun action
(p
: Parser)
954 var node_list
: nullable Object = null
955 var nodearraylist2
= p
.pop
956 var nodearraylist1
= p
.pop
957 var ttkburnnode2
= nodearraylist1
958 assert ttkburnnode2
isa nullable TTkBurn
959 var pvaluenode3
= nodearraylist2
960 assert pvaluenode3
isa nullable AValue
961 var pdirectivenode1
: nullable ABurnDirective = new ABurnDirective.init_aburndirective
(
965 node_list
= pdirectivenode1
966 p
.push
(p
.go_to
(_goto
), node_list
)
969 private class ReduceAction33
971 redef fun action
(p
: Parser)
973 var node_list
: nullable Object = null
974 var nodearraylist1
= p
.pop
975 var listnode2
= new Array[Object]
976 var plinenode1
= nodearraylist1
977 if plinenode1
!= null then
978 listnode2
.add
(plinenode1
)
980 node_list
= listnode2
981 p
.push
(p
.go_to
(_goto
), node_list
)
984 private class ReduceAction34
986 redef fun action
(p
: Parser)
988 var node_list
: nullable Object = null
989 var nodearraylist2
= p
.pop
990 var nodearraylist1
= p
.pop
991 var listnode3
= new Array[Object]
992 var listnode1
= nodearraylist1
993 assert listnode1
isa Array[Object]
994 var plinenode2
= nodearraylist2
995 listnode3
= concat
(listnode3
, listnode1
)
996 if plinenode2
!= null then
997 listnode3
.add
(plinenode2
)
999 node_list
= listnode3
1000 p
.push
(p
.go_to
(_goto
), node_list
)