Пример #1
0
        public override void Build(BuildItems items)
        {
            var lexer  = new Lexer(items.RawQuery, true);
            var parser = new FqlParser(lexer);

            items.RawQueryTree = parser.ComposeAll();

            Successor?.Build(items);
        }
        public override void Build(BuildItems items)
        {
            var queryTree = items.RawQueryTree;

            var prepareQuery          = new PrepareQueryVisitor(items.Engine);
            var prepareQueryTraverser = new PrepareQueryTraverseVisitor(prepareQuery);

            queryTree.Accept(prepareQueryTraverser);
            queryTree = prepareQuery.Root;

            var csharpRewriter         = new RunQueryVisitor(items.Engine);
            var csharpRewriteTraverser = new RunTraverseVisitor(csharpRewriter);

            queryTree.Accept(csharpRewriteTraverser);
            items.Result = csharpRewriter.Result;

            Successor?.Build(items);
        }