Beispiel #1
0
        private Nodes.ParseTreeNode ParseParenExpression(IEnumerator<Token> tokenStream)
        {
            if (tokenStream.Current.TokenType == TokenType.LeftParenthesis)
            {
                var parenNode = new Nodes.ParenthesisNode();

                parenNode.LeftParenthesis = tokenStream.Current;
                tokenStream.MoveNext();

                parenNode.Contained = ParseBinaryExpression(tokenStream, 0);

                if (tokenStream.Current.TokenType != TokenType.RightParenthesis)
                {
                    throw ThrowHelper(tokenStream);
                }

                parenNode.RightParenthesis = tokenStream.Current;
                tokenStream.MoveNext();

                return parenNode;
            }
            else
            {
                return this.ParseVariable(tokenStream);
            }
        }
 public override ConstraintViolation VisitParenthesisNode(ParenthesisNode parenNode)
 {
     return null;
 }
Beispiel #3
0
 public abstract ConstraintViolation VisitParenthesisNode(ParenthesisNode parenNode);