State 17 conflicts: 1 shift/reduce


Grammar

    0 $accept: program $end

    1 program: statement_list

    2 statement_list: statement_list statement
    3               | statement

    4 statement: if_stmt
    5          | other_stmt
    6          | stmt_block

    7 stmt_block: '{' statement_list '}'

    8 other_stmt: FOO ';'

    9 if_stmt: IF EXPR THEN statement ELSE statement
   10        | IF EXPR THEN statement


Terminals, with rules where they appear

$end (0) 0
';' (59) 8
'{' (123) 7
'}' (125) 7
error (256)
IF (258) 9 10
THEN (259) 9 10
ELSE (260) 9
FOO (261) 8
EXPR (262) 9 10


Nonterminals, with rules where they appear

$accept (11)
    on left: 0
program (12)
    on left: 1, on right: 0
statement_list (13)
    on left: 2 3, on right: 1 2 7
statement (14)
    on left: 4 5 6, on right: 2 3 9 10
stmt_block (15)
    on left: 7, on right: 6
other_stmt (16)
    on left: 8, on right: 5
if_stmt (17)
    on left: 9 10, on right: 4


state 0

    0 $accept: . program $end

    IF   shift, and go to state 1
    FOO  shift, and go to state 2
    '{'  shift, and go to state 3

    program         go to state 4
    statement_list  go to state 5
    statement       go to state 6
    stmt_block      go to state 7
    other_stmt      go to state 8
    if_stmt         go to state 9


state 1

    9 if_stmt: IF . EXPR THEN statement ELSE statement
   10        | IF . EXPR THEN statement

    EXPR  shift, and go to state 10


state 2

    8 other_stmt: FOO . ';'

    ';'  shift, and go to state 11


state 3

    7 stmt_block: '{' . statement_list '}'

    IF   shift, and go to state 1
    FOO  shift, and go to state 2
    '{'  shift, and go to state 3

    statement_list  go to state 12
    statement       go to state 6
    stmt_block      go to state 7
    other_stmt      go to state 8
    if_stmt         go to state 9


state 4

    0 $accept: program . $end

    $end  shift, and go to state 13


state 5

    1 program: statement_list .
    2 statement_list: statement_list . statement

    IF   shift, and go to state 1
    FOO  shift, and go to state 2
    '{'  shift, and go to state 3

    $default  reduce using rule 1 (program)

    statement   go to state 14
    stmt_block  go to state 7
    other_stmt  go to state 8
    if_stmt     go to state 9


state 6

    3 statement_list: statement .

    $default  reduce using rule 3 (statement_list)


state 7

    6 statement: stmt_block .

    $default  reduce using rule 6 (statement)


state 8

    5 statement: other_stmt .

    $default  reduce using rule 5 (statement)


state 9

    4 statement: if_stmt .

    $default  reduce using rule 4 (statement)


state 10

    9 if_stmt: IF EXPR . THEN statement ELSE statement
   10        | IF EXPR . THEN statement

    THEN  shift, and go to state 15


state 11

    8 other_stmt: FOO ';' .

    $default  reduce using rule 8 (other_stmt)


state 12

    2 statement_list: statement_list . statement
    7 stmt_block: '{' statement_list . '}'

    IF   shift, and go to state 1
    FOO  shift, and go to state 2
    '{'  shift, and go to state 3
    '}'  shift, and go to state 16

    statement   go to state 14
    stmt_block  go to state 7
    other_stmt  go to state 8
    if_stmt     go to state 9


state 13

    0 $accept: program $end .

    $default  accept


state 14

    2 statement_list: statement_list statement .

    $default  reduce using rule 2 (statement_list)


state 15

    9 if_stmt: IF EXPR THEN . statement ELSE statement
   10        | IF EXPR THEN . statement

    IF   shift, and go to state 1
    FOO  shift, and go to state 2
    '{'  shift, and go to state 3

    statement   go to state 17
    stmt_block  go to state 7
    other_stmt  go to state 8
    if_stmt     go to state 9


state 16

    7 stmt_block: '{' statement_list '}' .

    $default  reduce using rule 7 (stmt_block)


state 17

    9 if_stmt: IF EXPR THEN statement . ELSE statement
   10        | IF EXPR THEN statement .

    ELSE  shift, and go to state 18

    ELSE      [reduce using rule 10 (if_stmt)]
    $default  reduce using rule 10 (if_stmt)


state 18

    9 if_stmt: IF EXPR THEN statement ELSE . statement

    IF   shift, and go to state 1
    FOO  shift, and go to state 2
    '{'  shift, and go to state 3

    statement   go to state 19
    stmt_block  go to state 7
    other_stmt  go to state 8
    if_stmt     go to state 9


state 19

    9 if_stmt: IF EXPR THEN statement ELSE statement .

    $default  reduce using rule 9 (if_stmt)
