Ejemplo n.º 1
0
        public void Process(FunctionDefinitionNode function, IReplacementListener listener)
        {
            ProcessReplacementsVisitorChain visitorChain = new ProcessReplacementsVisitorChain(this, listener, isPostOrder: true);
            ParseTreeChildrenVisitor        parseTreeChildrenVisitor
                = new ParseTreeChildrenVisitor(null, visitorChain.ReplacementVisitor, visitorChain.ChildrenVisitor);
            ProcessParseTreeReplacementsVisitor parseTreeReplacementsVisitor
                = new ProcessParseTreeReplacementsVisitor(this, listener);

            visitorChain.ExpressionChildrenVisitor.ExtensionChildrenVisitor = new ParseTreeVisitorExtension(parseTreeChildrenVisitor);
            visitorChain.ExpressionReplacementsVisitor.ExtensionVisitor     = new ParseTreeVisitorExtension(parseTreeReplacementsVisitor);
            visitorChain.ProcessReplacements(function);
        }
Ejemplo n.º 2
0
        public void Process(FunctionDefinitionNode function, IReplacementListener listener)
        {
            // TODO: Helper class to reduce repeating of this setup code.
            ProcessReplacementsVisitorChain visitorChain = new ProcessReplacementsVisitorChain(this, listener);
            ParseTreeChildrenVisitor        parseTreeChildrenVisitor
                = new ParseTreeChildrenVisitor(visitorChain.ReplacementVisitor, null, visitorChain.ChildrenVisitor);
            ProcessParseTreeReplacementsVisitor parseTreeReplacementsVisitor
                = new ProcessParseTreeReplacementsVisitor(this, listener);

            visitorChain.ExpressionChildrenVisitor.ExtensionChildrenVisitor = new ParseTreeVisitorExtension(parseTreeChildrenVisitor);
            visitorChain.ExpressionReplacementsVisitor.ExtensionVisitor     = new ParseTreeVisitorExtension(parseTreeReplacementsVisitor);

            visitorChain.ProcessReplacements(function);
        }