Example #1
0
		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;
		}
Example #2
0
		public CompletionParser(IErrorReporter errorReporter, string source)
		{
			_errorReporter = errorReporter;
			_tokenStream = TokenStream.FromSource(errorReporter, source);
			_source = source;
		}