private GenericExpressionNode ExprPrime(string expression, GenericExpressionNode lhs) { if (Same(expression, Token.TokenType.EndOfInput)) { return(lhs); } else if (Same(expression, Token.TokenType.Or)) { OperatorExpressionNode orNode = new OrExpressionNode(); GenericExpressionNode rhs = BooleanTerm(expression); orNode.LeftChild = lhs; orNode.RightChild = rhs; return(ExprPrime(expression, orNode)); } else { // I think this is ok. ExprPrime always shows up at // the rightmost side of the grammar rhs, the EndOfInput case // takes care of things return(lhs); } }
private GenericExpressionNode ExprPrime(string expression, GenericExpressionNode lhs) { if (Same(expression, Token.TokenType.EndOfInput)) { return lhs; } else if (Same(expression, Token.TokenType.Or)) { OperatorExpressionNode orNode = new OrExpressionNode(); GenericExpressionNode rhs = BooleanTerm(expression); orNode.LeftChild = lhs; orNode.RightChild = rhs; return ExprPrime(expression, orNode); } else { // I think this is ok. ExprPrime always shows up at // the rightmost side of the grammar rhs, the EndOfInput case // takes care of things return lhs; } }