Esempio n. 1
0
 /**
  * Constructor
  */
 function __construct()
 {
     // super-construct with Lex and Grammar
     parent::__construct(new BNFLex(), new BNFGrammar());
     // set pre-compiled parse table
     $this->Table = new BNFParseTable();
     // register custom parse nodes ...
     $this->register_node_class(BNF_RULES, 'BNFRulesNode');
     $this->register_node_class(BNF_RULE, 'BNFRuleNode');
     $this->register_node_class(BNF_EMPTY_RULE, 'BNFRuleNode');
     $this->register_node_class(BNF_EXPRESSION, 'BNFExpressionNode');
     $this->register_node_class(BNF_LIST, 'BNFListNode');
     $this->register_node_class(BNF_TERM, 'BNFTermNode');
 }