public override ConstraintViolation VisitVariableNode(VariableNode varNode)
        {
            var value = varNode.Variable.Value;

            if (!this.variables.Any(v => this.comparison.Equals(value, v)))
            {
                return new ConstraintViolation(varNode, "The variable name '" + value + "' is not allowed.");
            }

            return null;
        }
 public override ConstraintViolation VisitVariableNode(VariableNode varNode)
 {
     return null;
 }
Exemplo n.º 3
0
        private Nodes.ParseTreeNode ParseVariable(IEnumerator<Token> tokenStream)
        {
            if (tokenStream.Current.TokenType == TokenType.Variable)
            {
                var varNode = new Nodes.VariableNode
                {
                    Variable = tokenStream.Current
                };

                tokenStream.MoveNext();
                return varNode;
            }
            else
            {
                throw ThrowHelper(tokenStream);
            }
        }
Exemplo n.º 4
0
 public abstract ConstraintViolation VisitVariableNode(VariableNode varNode);