private void Bar(string input) { Debug.WriteLine("Bar"); AntlrInputStream inputStream = new AntlrInputStream(input); TSqlLexer lexer = new TSqlLexer(inputStream); CommonTokenStream tokens = new CommonTokenStream(lexer); TSqlParser parser = new TSqlParser(tokens); var parseTree = parser.select_statement(); ParseTreeWalker walker = new ParseTreeWalker(); TSqlParserListenerExtended loader = new TSqlParserListenerExtended(); walker.Walk(loader, parseTree); }
private void Foo(string input) { Debug.WriteLine("Foo"); AntlrInputStream antlrInput = new AntlrInputStream(input); TSqlLexer lexer = new TSqlLexer(antlrInput); CommonTokenStream tokens = new CommonTokenStream(lexer); TSqlParser parser = new TSqlParser(tokens); TSqlParserListenerExtended listener = new TSqlParserListenerExtended(); parser.select_statement().EnterRule(listener); parser.search_condition().EnterRule(listener); }