Exemple #1
0
        private static IPointcutValueNode Process(string text)
        {
            var lexer  = new PointcutLexer(new ANTLRStringStream(text));
            var parser = new PointcutParser(new CommonTokenStream(lexer));
            //new DumpAstVisitor().visit((ITree)parser.pointcut().Tree);

            var walker = new PointcutWalker(new CommonTreeNodeStream(parser.pointcut().Tree));

            return(walker.pointcut().value);
        }
Exemple #2
0
        public void HenTest()
        {
            var str    = string.Empty;
            var lexer  = new PointcutLexer(new ANTLRStringStream(str));
            var parser = new PointcutParser(new CommonTokenStream(lexer));

            var q = parser.pointcut();

            new DumpAstVisitor().visit((ITree)q.Tree);
        }
Exemple #3
0
        public void BuildFromSaql(AspectDefinition aspect, string saql, IPointcut pointcut)
        {
            try
            {
                var lexer  = new PointcutLexer(new ANTLRStringStream(saql));
                var parser = new PointcutParser(new CommonTokenStream(lexer));

                var walker = new PointcutWalker(aspect, pointcut, new CommonTreeNodeStream(parser.pointcut().Tree));

                var node = walker.pointcut().value;
                if (node != null)
                {
                    node.Build(pointcut);
                }
            }
            catch (SheepAspectException e)
            {
                throw new PointcutDefinitionException(aspect, pointcut, e);
            }
            catch (Exception e)
            {
                throw new PointcutDefinitionException(aspect, pointcut, "Error parsing pointcut: " + e.Message, e);
            }
        }