public static TokenStream FromSource(IErrorReporter errorReporter, string source) { Lexer lexer = new Lexer(errorReporter, source); List<Token> tokenList = new List<Token>(); while (lexer.NextToken()) { if (lexer.TokenID == TokenId.SELECT) lexer.IsQuery = true; Token token = lexer.GetToken(); tokenList.Add(token); } TokenStream result = new TokenStream(); result._tokens = tokenList.ToArray(); return result; }
public CompletionParser(IErrorReporter errorReporter, string source) { _errorReporter = errorReporter; _tokenStream = TokenStream.FromSource(errorReporter, source); _source = source; }