public void Validate(LValue targetLValue, FunctionDefinitionNode function) { _targetLValue = targetLValue; _isTargetCurrentlyAssigned = false; function.Body.AcceptStatementVisitor(this); }
public bool Covers(LValue other) { for (int i = 0, ilen = Math.Min(_path.Length, other._path.Length); i < ilen; ++i) { DeclarationNode a = _path[i]; DeclarationNode b = other._path[i]; if (a != b) { return(false); } } return(true); }
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); }