end
end
-redef class Parser
+class Parser
+special ParserTable
# Associated lexer
attr _lexer: Lexer
attr _reduce_table: Array[ReduceAction]
private meth build_reduce_table
do
- _reduce_table = new Array[ReduceAction].with(
+ _reduce_table = new Array[ReduceAction].with_items(
$ foreach {rules/rule}
new ReduceAction@index[-sep ','-]
$ end foreach
$ template make_parser_tables()
# Parser that build a full AST
-class Parser
- attr _action_table: Array[Array[Int]]
+abstract class ParserTable
+ attr _action_table: Array[Array[Int]] = null
private meth build_action_table
do
_action_table = once [
end
$ end foreach
- attr _goto_table: Array[Array[Int]]
+ attr _goto_table: Array[Array[Int]] = null
private meth build_goto_table
do
_goto_table = once [