Пример #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
 public LR1ParsableLanguage(
     Language l,
     TypedShakeSelector <string> selector,
     Cortex.Grammar.Grammar g,
     string terminateSymbol,
     SemanticRule onAccept,
     bool supressMessages,
     Func <Token <string>, bool> shouldKeep)
     : this(l, selector,
            new LR1Parser(g, terminateSymbol, onAccept, supressMessages),
            shouldKeep)
 {
 }
Пример #3
0
 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)
 {
 }
Пример #4
0
 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,
     SemanticRule onAccept,
     bool supressMessages,
     Func <Token <string>, bool> shouldKeep)
     : this(new Language(name, version, idType,
                         comments, symbols, regexSymbols,
                         keywords), selector, g, terminateSymbol, onAccept, supressMessages,
            shouldKeep)
 {
 }
Пример #5
0
 public LR1Parser(Cortex.Grammar.Grammar g, LR1ParsingTable table, LR1GotoTable gotoTable, SemanticRule r) : this(g, DEFAULT_TERMINATE_SYMBOL, table, gotoTable, r)
 {
 }
Пример #6
0
 public LR1Parser(Cortex.Grammar.Grammar g) : this(g, DEFAULT_TERMINATE_SYMBOL)
 {
 }
Пример #7
0
 public LR1Parser(Cortex.Grammar.Grammar g, string terminateSymbol) : this(g, terminateSymbol, (x) => x[0])
 {
 }
Пример #8
0
 public LR1Parser(Cortex.Grammar.Grammar g, string terminateSymbol, SemanticRule r) : this(g, terminateSymbol, r, false)
 {
 }
Пример #9
0
 public LR1Parser(Cortex.Grammar.Grammar g, string terminateSymbol, SemanticRule r, bool supressMessages)
     : base(g, terminateSymbol, r, supressMessages, true)
 {
 }