public void Process() { SyntaxTreeDelegator syntaxTreeDelegator = new SyntaxTreeDelegator(); StatementDelegator statementDelegator = new StatementDelegator(); ExpressionDelegator expressionDelegator = new ExpressionDelegator(); BasicExpressionDelegator basicExpressionDelegator = new BasicExpressionDelegator(); syntaxTreeDelegator.StatementVisitor = statementDelegator; statementDelegator.ReturnVisitor = this; syntaxTreeDelegator.ExpressionVisitor = expressionDelegator; expressionDelegator.BasicVisitor = basicExpressionDelegator; basicExpressionDelegator.AssignmentVisitor = this; SyntaxTreeDelegator childrenVisitor = new SyntaxTreeDelegator(); StatementChildrenVisitor statementChildrenVisitor = new StatementChildrenVisitor(syntaxTreeDelegator, childrenVisitor); childrenVisitor.StatementVisitor = statementChildrenVisitor; childrenVisitor.ExpressionVisitor = new ExpressionChildrenVisitor(syntaxTreeDelegator, null, childrenVisitor); _function.Body.VisitStatements(statementChildrenVisitor); }
public LValueAssignmentValidator(IErrorManager errors) { _errors = errors; _targetLValue = new LValue(Array.Empty <DeclarationNode>()); BasicExpressionDelegator basicExpressionDelegator = new BasicExpressionDelegator(); basicExpressionDelegator.VariableVisitor = this; basicExpressionDelegator.AccessVisitor = this; basicExpressionDelegator.AssignmentVisitor = this; ExpressionDelegator expressionDelegator = new ExpressionDelegator(); expressionDelegator.BasicVisitor = basicExpressionDelegator; SyntaxTreeDelegator visitor = new SyntaxTreeDelegator(); visitor.ExpressionVisitor = expressionDelegator; visitor.StatementVisitor = this; _childrenVisitor.ExpressionVisitor = new ExpressionChildrenVisitor(visitor, null, _childrenVisitor); }