public TSQLStatementReader(
     TextReader tsqlStream)
 {
     tokenizer = new TSQLTokenizer(tsqlStream);
     // move to first token
     tokenizer.MoveNext();
 }
 public void SelectClause_StopAtFrom()
 {
     using (StringReader reader = new StringReader(@"select a from b;"))
     using (TSQLTokenizer tokenizer = new TSQLTokenizer(reader))
     {
         Assert.IsTrue(tokenizer.Read());
         TSQLSelectClause select = new TSQLSelectClauseParser().Parse(tokenizer);
         Assert.AreEqual(2, select.Tokens.Count);
         Assert.AreEqual(TSQLKeywords.FROM, tokenizer.Current.AsKeyword.Keyword);
     }
 }
Example #3
0
 public void Parse_GOFromStream()
 {
     using (TextReader reader = new StringReader("GO"))
     using (TSQLTokenizer lexer = new TSQLTokenizer(reader))
     {
         TokenComparisons.CompareStreamToList(
             new List<TSQLToken>()
                 {
                     new TSQLKeyword(0, "GO")
                 },
                 lexer);
     }
 }
 public TSQLStatementReader(TSQLTokenizer tokenizer)
 {
     _tokenizer = tokenizer;
 }
 public TSQLStatementReader(
     TextReader tsqlStream)
 {
     _tokenizer = new TSQLTokenizer(tsqlStream);
 }
 public TSQLStatementReader(
     string tsqlText)
 {
     _tokenizer = new TSQLTokenizer(tsqlText);
 }
 public static void CompareStreamToList(List<TSQLToken> expected, TSQLTokenizer lexer)
 {
     CompareTokenLists(expected, lexer.ToList());
 }
Example #8
0
 public void Parse_uspSearchCandidateResumes_NoWhitespace()
 {
     using (StringReader reader = new StringReader(Resources.AdventureWorks2014_dbo_uspSearchCandidateResumes))
     using (TSQLTokenizer lexer = new TSQLTokenizer(reader))
     {
         TokenComparisons.CompareStreamStartToList(
             GetuspSearchCandidateResumesTokens()
                 .Where(t => !(t is TSQLWhitespace)).ToList(),
             lexer);
     }
 }
Example #9
0
 public void Parse_uspSearchCandidateResumes()
 {
     using (StringReader reader = new StringReader(Resources.AdventureWorks2014_dbo_uspSearchCandidateResumes))
     using (TSQLTokenizer lexer = new TSQLTokenizer(reader) { IncludeWhitespace = true })
     {
         TokenComparisons.CompareStreamStartToList(
             GetuspSearchCandidateResumesTokens(),
             lexer);
     }
 }
 public TSQLStatementReader(TSQLTokenizer tokenizer)
 {
     _tokenizer = tokenizer;
 }
        public TSQLStatementReader(
			TextReader tsqlStream)
        {
            _tokenizer = new TSQLTokenizer(tsqlStream);
        }
        public TSQLStatementReader(
			string tsqlText)
        {
            _tokenizer = new TSQLTokenizer(tsqlText);
        }