return left;
}
}
private Expression parseConditionalExpression(boolean inFlag) throws CompilerException {
Expression expression = parseLogicalOrExpression(inFlag);
// conditional expressions are right associative
if (nextToken == Token.OPERATOR_CONDITIONAL) {
readToken(Token.OPERATOR_CONDITIONAL);
Expression trueExpression = parseAssignmentExpression(inFlag);
readToken(Token.OPERATOR_COLON);
Expression falseExpression = parseAssignmentExpression(inFlag);
return new ConditionalExpression(expression, trueExpression, falseExpression);
} else {
return expression;
}
}