Exemplo n.º 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]);
 }
Exemplo n.º 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)
 {
 }
Exemplo n.º 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)
 {
 }
Exemplo n.º 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)
 {
 }
Exemplo n.º 5
0
 public LR1Parser(Cortex.Grammar.Grammar g, LR1ParsingTable table, LR1GotoTable gotoTable, SemanticRule r) : this(g, DEFAULT_TERMINATE_SYMBOL, table, gotoTable, r)
 {
 }
Exemplo n.º 6
0
 public LR1Parser(Cortex.Grammar.Grammar g) : this(g, DEFAULT_TERMINATE_SYMBOL)
 {
 }
Exemplo n.º 7
0
 public LR1Parser(Cortex.Grammar.Grammar g, string terminateSymbol) : this(g, terminateSymbol, (x) => x[0])
 {
 }
Exemplo n.º 8
0
 public LR1Parser(Cortex.Grammar.Grammar g, string terminateSymbol, SemanticRule r) : this(g, terminateSymbol, r, false)
 {
 }
Exemplo n.º 9
0
 public LR1Parser(Cortex.Grammar.Grammar g, string terminateSymbol, SemanticRule r, bool supressMessages)
     : base(g, terminateSymbol, r, supressMessages, true)
 {
 }