private void AssertIsValid(string text) { Log.Debug(".assertIsValid Trying text=" + text); Pair<ITree, CommonTokenStream> ast = Parse(text); Log.Debug(".assertIsValid success, tree walking..."); SupportParserHelper.DisplayAST(ast.First); Log.Debug(".assertIsValid done"); }
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); }
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 void TestDisplayAST() { string expression = "select * from A where exp > ANY (select a from B)"; Log.Debug(".testDisplayAST parsing: " + expression); Pair<ITree, CommonTokenStream> ast = Parse(expression); SupportParserHelper.DisplayAST(ast.First); Log.Debug(".testDisplayAST walking..."); EPLTreeWalkerListener listener = SupportEPLTreeWalkerFactory.MakeWalker(ast.Second); var walker = new ParseTreeWalker(); // create standard walker walker.Walk(listener, (IParseTree) ast.First); // initiate walk of tree with listener }