public void TestDisplayAST() { string expression = "A -> [10] B until C -> D"; Log.Debug(".testDisplayAST parsing: " + expression); Pair <ITree, CommonTokenStream> ast = Parse(expression); SupportParserHelper.DisplayAST(ast.First); }
private void AssertIsValid(string text) { Log.Debug(".assertIsValid Trying text=" + text); var ast = Parse(text); Log.Debug(".assertIsValid success, tree walking..."); SupportParserHelper.DisplayAST(ast.First); Log.Debug(".assertIsValid done"); }
public void TestParserNodeGeneration() { string expression = "a(m=1) -> not b() or every c() and d() where a:b (5) and timer:interval(10)"; Log.Debug(".testParserNodeGeneration parsing: " + expression); Pair <ITree, CommonTokenStream> parsed = Parse(expression); ITree ast = parsed.First; SupportParserHelper.DisplayAST(ast); }
public static EPLTreeWalkerListener ParseAndWalkEPL( IContainer container, string expression) { Log.Debug(".parseAndWalk Trying text=" + expression); var ast = ParseEPL(expression); Log.Debug(".parseAndWalk success, tree walking..."); SupportParserHelper.DisplayAST(ast.First); var listener = SupportEPLTreeWalkerFactory.MakeWalker(ast.Second, SupportClasspathImport.GetInstance(container)); var walker = new ParseTreeWalker(); // create standard walker walker.Walk(listener, (IParseTree)ast.First); // initiate walk of tree with listener return(listener); }
public void TestDisplayAST() { var expression = "select * from A where exp > ANY (select a from B)"; Log.Debug(".testDisplayAST parsing: " + expression); var ast = Parse(expression); SupportParserHelper.DisplayAST(ast.First); Log.Debug(".testDisplayAST walking..."); var listener = SupportEPLTreeWalkerFactory.MakeWalker(container, ast.Second); var walker = new ParseTreeWalker(); // create standard walker walker.Walk(listener, (IParseTree)ast.First); // initiate walk of tree with listener }