Ejemplo n.º 1
0
        public void Validate(LValue targetLValue, FunctionDefinitionNode function)
        {
            _targetLValue = targetLValue;
            _isTargetCurrentlyAssigned = false;

            function.Body.AcceptStatementVisitor(this);
        }
Ejemplo n.º 2
0
        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);
        }
Ejemplo n.º 3
0
        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);
        }