/* File: else1.y The classic dangling else problem causes a shift reduce conflict. */ %{ %} %token IF THEN ELSE %token FOO %token EXPR %% program : statement_list ; statement_list : statement_list statement | statement ; statement : if_stmt | other_stmt | stmt_block ; stmt_block : '{' statement_list '}' ; other_stmt : FOO ';' ; if_stmt : IF EXPR THEN statement ELSE statement | IF EXPR THEN statement ; %%