Пример #1
0
 public EnhancedLR1Parser(EnhancedGrammar g, string terminateSymbol, EnhancedParsingTable table, SemanticRule r)
     : base(g, terminateSymbol, r, true, false)
 {
     this.table = table;
     baseToken  = new Token <string>(TerminateSymbol, TerminateSymbol, TerminateSymbol.Length);
     stateStack = new Stack <object>();
     initial    = new LookaheadRule(TerminateSymbol, TargetGrammar[0]);
 }
Пример #2
0
 public EnhancedLR1ParsableLanguage(
     Language l,
     TypedShakeSelector <string> selector,
     EnhancedGrammar g,
     string terminateSymbol,
     EnhancedParsingTable table,
     SemanticRule onAccept,
     Func <Token <string>, bool> shouldKeep)
     : this(l, selector,
            new EnhancedLR1Parser(g, terminateSymbol, table, onAccept),
            shouldKeep)
 {
 }
Пример #3
0
 public EnhancedLR1ParsableLanguage(
     string name,
     string version,
     string idType,
     IEnumerable <Comment> comments,
     IEnumerable <Symbol> symbols,
     IEnumerable <RegexSymbol> regexSymbols,
     IEnumerable <Keyword> keywords,
     TypedShakeSelector <string> selector,
     EnhancedGrammar g,
     string terminateSymbol,
     EnhancedParsingTable table,
     SemanticRule onAccept,
     Func <Token <string>, bool> shouldKeep)
     : this(new Language(name, version, idType,
                         comments, symbols, regexSymbols,
                         keywords), selector, g, terminateSymbol, table, onAccept,
            shouldKeep)
 {
 }
Пример #4
0
 protected override void PreTableConstruction()
 {
     base.PreTableConstruction();
     table = new EnhancedParsingTable(TargetGrammar.SymbolTable.Concat(
                                          new string[] { TerminateSymbol }), 0);
 }
Пример #5
0
 public EnhancedLR1Parser(EnhancedGrammar g, EnhancedParsingTable table, SemanticRule r) : this(g, DEFAULT_TERMINATE_SYMBOL, table, r)
 {
 }