2 # This file was generated by SableCC (http://www.sablecc.org/).
3 module parser
is no_warning
("missing-doc", "old-init")
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
)
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]
302 if l1
.is_empty
then return l2
307 init(g
: Int) do _goto
= g
310 private class ReduceAction0
312 redef fun action
(p
: Parser)
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
(
324 node_list
= plistingnode1
325 p
.push
(p
.go_to
(_goto
), node_list
)
328 private class ReduceAction1
330 redef fun action
(p
: Parser)
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
(
346 node_list
= plistingnode1
347 p
.push
(p
.go_to
(_goto
), node_list
)
350 private class ReduceAction2
352 redef fun action
(p
: Parser)
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
(
367 node_list
= plistingnode1
368 p
.push
(p
.go_to
(_goto
), node_list
)
371 private class ReduceAction3
373 redef fun action
(p
: Parser)
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
(
392 node_list
= plistingnode1
393 p
.push
(p
.go_to
(_goto
), node_list
)
396 private class ReduceAction4
398 redef fun action
(p
: Parser)
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
(
409 node_list
= plinenode1
410 p
.push
(p
.go_to
(_goto
), node_list
)
413 private class ReduceAction5
415 redef fun action
(p
: Parser)
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
(
429 node_list
= plinenode1
430 p
.push
(p
.go_to
(_goto
), node_list
)
433 private class ReduceAction6
435 redef fun action
(p
: Parser)
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
(
449 node_list
= plinenode1
450 p
.push
(p
.go_to
(_goto
), node_list
)
453 private class ReduceAction7
455 redef fun action
(p
: Parser)
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
(
472 node_list
= plinenode1
473 p
.push
(p
.go_to
(_goto
), node_list
)
476 private class ReduceAction8
478 redef fun action
(p
: Parser)
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
(
493 node_list
= plinenode1
494 p
.push
(p
.go_to
(_goto
), node_list
)
497 private class ReduceAction9
499 redef fun action
(p
: Parser)
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
(
517 node_list
= plinenode1
518 p
.push
(p
.go_to
(_goto
), node_list
)
521 private class ReduceAction10
523 redef fun action
(p
: Parser)
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
(
541 node_list
= plinenode1
542 p
.push
(p
.go_to
(_goto
), node_list
)
545 private class ReduceAction11
547 redef fun action
(p
: Parser)
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
(
568 node_list
= plinenode1
569 p
.push
(p
.go_to
(_goto
), node_list
)
572 private class ReduceAction12
574 redef fun action
(p
: Parser)
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
(
589 node_list
= plinenode1
590 p
.push
(p
.go_to
(_goto
), node_list
)
593 private class ReduceAction13
595 redef fun action
(p
: Parser)
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
(
613 node_list
= plinenode1
614 p
.push
(p
.go_to
(_goto
), node_list
)
617 private class ReduceAction14
619 redef fun action
(p
: Parser)
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
(
637 node_list
= plinenode1
638 p
.push
(p
.go_to
(_goto
), node_list
)
641 private class ReduceAction15
643 redef fun action
(p
: Parser)
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
(
664 node_list
= plinenode1
665 p
.push
(p
.go_to
(_goto
), node_list
)
668 private class ReduceAction16
670 redef fun action
(p
: Parser)
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
(
683 node_list
= plabeldeclnode1
684 p
.push
(p
.go_to
(_goto
), node_list
)
687 private class ReduceAction17
689 redef fun action
(p
: Parser)
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
(
698 node_list
= pinstructionnode1
699 p
.push
(p
.go_to
(_goto
), node_list
)
702 private class ReduceAction18
704 redef fun action
(p
: Parser)
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
(
717 node_list
= pinstructionnode1
718 p
.push
(p
.go_to
(_goto
), node_list
)
721 private class ReduceAction19
723 redef fun action
(p
: Parser)
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
(
732 node_list
= poperandnode1
733 p
.push
(p
.go_to
(_goto
), node_list
)
736 private class ReduceAction20
738 redef fun action
(p
: Parser)
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
(
755 node_list
= poperandnode1
756 p
.push
(p
.go_to
(_goto
), node_list
)
759 private class ReduceAction21
761 redef fun action
(p
: Parser)
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
(
770 node_list
= pvaluenode1
771 p
.push
(p
.go_to
(_goto
), node_list
)
774 private class ReduceAction22
776 redef fun action
(p
: Parser)
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
(
785 node_list
= pvaluenode1
786 p
.push
(p
.go_to
(_goto
), node_list
)
789 private class ReduceAction23
791 redef fun action
(p
: Parser)
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
(
800 node_list
= pvaluenode1
801 p
.push
(p
.go_to
(_goto
), node_list
)
804 private class ReduceAction24
806 redef fun action
(p
: Parser)
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
(
815 node_list
= pvaluenode1
816 p
.push
(p
.go_to
(_goto
), node_list
)
819 private class ReduceAction25
821 redef fun action
(p
: Parser)
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
(
830 node_list
= pvaluenode1
831 p
.push
(p
.go_to
(_goto
), node_list
)
834 private class ReduceAction26
836 redef fun action
(p
: Parser)
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
(
849 node_list
= pdirectivenode1
850 p
.push
(p
.go_to
(_goto
), node_list
)
853 private class ReduceAction27
855 redef fun action
(p
: Parser)
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
(
868 node_list
= pdirectivenode1
869 p
.push
(p
.go_to
(_goto
), node_list
)
872 private class ReduceAction28
874 redef fun action
(p
: Parser)
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
(
887 node_list
= pdirectivenode1
888 p
.push
(p
.go_to
(_goto
), node_list
)
891 private class ReduceAction29
893 redef fun action
(p
: Parser)
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
(
906 node_list
= pdirectivenode1
907 p
.push
(p
.go_to
(_goto
), node_list
)
910 private class ReduceAction30
912 redef fun action
(p
: Parser)
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
(
925 node_list
= pdirectivenode1
926 p
.push
(p
.go_to
(_goto
), node_list
)
929 private class ReduceAction31
931 redef fun action
(p
: Parser)
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
(
944 node_list
= pdirectivenode1
945 p
.push
(p
.go_to
(_goto
), node_list
)
948 private class ReduceAction32
950 redef fun action
(p
: Parser)
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
(
963 node_list
= pdirectivenode1
964 p
.push
(p
.go_to
(_goto
), node_list
)
967 private class ReduceAction33
969 redef fun action
(p
: Parser)
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
)
978 node_list
= listnode2
979 p
.push
(p
.go_to
(_goto
), node_list
)
982 private class ReduceAction34
984 redef fun action
(p
: Parser)
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
)
997 node_list
= listnode3
998 p
.push
(p
.go_to
(_goto
), node_list
)