// $ANTLR start "conditional_expression"
// C:\\Users\\line47\\workspace\\ObjCFYPA\\src\\com\\icona\\antlr\\main\\ObjectiveC.g:850:1: conditional_expression returns [TertiaryExpression expression] : exp1= logical_or_expression ( '?' exp2= logical_or_expression ':' exp3= logical_or_expression )? ;
public final TertiaryExpression conditional_expression() throws RecognitionException {
TertiaryExpression expression = null;
BinaryExpression exp1 =null;
BinaryExpression exp2 =null;
BinaryExpression exp3 =null;
expression =new TertiaryExpression(null,-1);
try {
// C:\\Users\\line47\\workspace\\ObjCFYPA\\src\\com\\icona\\antlr\\main\\ObjectiveC.g:855:2: (exp1= logical_or_expression ( '?' exp2= logical_or_expression ':' exp3= logical_or_expression )? )
// C:\\Users\\line47\\workspace\\ObjCFYPA\\src\\com\\icona\\antlr\\main\\ObjectiveC.g:856:2: exp1= logical_or_expression ( '?' exp2= logical_or_expression ':' exp3= logical_or_expression )?
{
pushFollow(FOLLOW_logical_or_expression_in_conditional_expression2801);
exp1=logical_or_expression();
state._fsp--;
if (state.failed) return expression;
if ( state.backtracking==0 ) {
expression.setConditionExpression((Expression)exp1);
}
// C:\\Users\\line47\\workspace\\ObjCFYPA\\src\\com\\icona\\antlr\\main\\ObjectiveC.g:860:2: ( '?' exp2= logical_or_expression ':' exp3= logical_or_expression )?
int alt66=2;
int LA66_0 = input.LA(1);
if ( (LA66_0==53) ) {
alt66=1;
}
switch (alt66) {
case 1 :
// C:\\Users\\line47\\workspace\\ObjCFYPA\\src\\com\\icona\\antlr\\main\\ObjectiveC.g:861:3: '?' exp2= logical_or_expression ':' exp3= logical_or_expression
{
match(input,53,FOLLOW_53_in_conditional_expression2812); if (state.failed) return expression;
pushFollow(FOLLOW_logical_or_expression_in_conditional_expression2816);
exp2=logical_or_expression();
state._fsp--;
if (state.failed) return expression;
if ( state.backtracking==0 ) {
expression.setIfExpression((Expression)exp2);
}
match(input,41,FOLLOW_41_in_conditional_expression2825); if (state.failed) return expression;
pushFollow(FOLLOW_logical_or_expression_in_conditional_expression2829);
exp3=logical_or_expression();
state._fsp--;
if (state.failed) return expression;
if ( state.backtracking==0 ) {
expression.setElseExpression((Expression)exp3);
}
}
break;