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;
 }
Esempio 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);
            }
        }
Esempio n. 4
0
 public abstract ConstraintViolation VisitVariableNode(VariableNode varNode);