예제 #1
0
        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);
        }
예제 #2
0
        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");
        }
예제 #3
0
        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);
        }
예제 #4
0
        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);
        }
예제 #5
0
        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
        }