コード例 #1
0
 public LR1Parser(Cortex.Grammar.Grammar g, string terminateSymbol, LR1ParsingTable table, LR1GotoTable gotoTable, SemanticRule r)
     : base(g, terminateSymbol, r, true, false)
 {
     this.actionTable = table;
     this.gotoTable   = gotoTable;
     this.onAccept    = r;
     baseToken        = new Token <string>(TerminateSymbol, TerminateSymbol, TerminateSymbol.Length);
     stateStack       = new Stack <object>();
     initial          = new LookaheadRule(TerminateSymbol, TargetGrammar[0]);
 }
コード例 #2
0
ファイル: ParsableLanguage.cs プロジェクト: DrItanium/Cortex
 public LR1ParsableLanguage(
     Language l,
     TypedShakeSelector <string> selector,
     Cortex.Grammar.Grammar g,
     string terminateSymbol,
     LR1ParsingTable table,
     LR1GotoTable gotoTable,
     SemanticRule onAccept,
     Func <Token <string>, bool> shouldKeep)
     : this(l, selector,
            new LR1Parser(g, terminateSymbol, table, gotoTable, onAccept),
            shouldKeep)
 {
 }
コード例 #3
0
ファイル: ParsableLanguage.cs プロジェクト: DrItanium/Cortex
 public LR1ParsableLanguage(
     string name,
     string version,
     string idType,
     IEnumerable <Comment> comments,
     IEnumerable <Symbol> symbols,
     IEnumerable <RegexSymbol> regexSymbols,
     IEnumerable <Keyword> keywords,
     TypedShakeSelector <string> selector,
     Cortex.Grammar.Grammar g,
     string terminateSymbol,
     LR1ParsingTable table,
     LR1GotoTable gotoTable,
     SemanticRule onAccept,
     Func <Token <string>, bool> shouldKeep)
     : this(new Language(name, version, idType,
                         comments, symbols, regexSymbols,
                         keywords), selector, g, terminateSymbol, table, gotoTable, onAccept,
            shouldKeep)
 {
 }
コード例 #4
0
 public LR1Parser(Cortex.Grammar.Grammar g, LR1ParsingTable table, LR1GotoTable gotoTable, SemanticRule r) : this(g, DEFAULT_TERMINATE_SYMBOL, table, gotoTable, r)
 {
 }
コード例 #5
0
 protected override void SetupExtraParserElements()
 {
     base.SetupExtraParserElements();
     actionTable = new LR1ParsingTable();
     gotoTable   = new LR1GotoTable();
 }