public Lexer() { LexerInfoTable = new InfoTable(); // Experimental thing // I add some lexems, that my grammar consist of, to info table beforehand LexerInfoTable.AddKeyword(_keywords); LexerInfoTable.AddLongDelimiter(_longDelimiters); LexerInfoTable.AddShortDelimiter(new List <string> { ";", ".", "=", "<", ">" }); }
public Parser(List <Token> tokens, InfoTable infoT) { _tokens = tokens; _infoTable = infoT; _grammarLexems = new Dictionary <string, int>(); List <KeyValuePair <string, int> > list = new List <KeyValuePair <string, int> >(); list = infoT.GetKeywords() .Concat(infoT.GetShortDelimiters()) .Concat(infoT.GetLongDelimiters()) .ToList(); foreach (KeyValuePair <string, int> kv in list) { _grammarLexems.Add(kv.Key, kv.Value); } }
public Parser() { _tokens = new List <Token>(); _infoTable = new InfoTable(); _grammarLexems = new Dictionary <string, int>(); }
public Lexer(InfoTable infoT) { LexerInfoTable = infoT; }