Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Rules useless in parser due to conflicts
- 6 typename: Identifier
- State 6 conflicts: 1 reduce/reduce
- Grammar
- 0 $accept: generalExp $end
- 1 generalExp: variable
- 2 | LRPAR generalExp RRPAR
- 3 | castExp
- 4 castExp: LRPAR typename RRPAR generalExp
- 5 variable: Identifier
- 6 typename: Identifier
- Terminals, with rules where they appear
- $end (0) 0
- error (256)
- Identifier (258) 5 6
- LRPAR (259) 2 4
- RRPAR (260) 2 4
- Nonterminals, with rules where they appear
- $accept (6)
- on left: 0
- generalExp (7)
- on left: 1 2 3, on right: 0 2 4
- castExp (8)
- on left: 4, on right: 3
- variable (9)
- on left: 5, on right: 1
- typename (10)
- on left: 6, on right: 4
- State 0
- 0 $accept: . generalExp $end
- Identifier shift, and go to state 1
- LRPAR shift, and go to state 2
- generalExp go to state 3
- castExp go to state 4
- variable go to state 5
- State 1
- 5 variable: Identifier .
- $default reduce using rule 5 (variable)
- State 2
- 2 generalExp: LRPAR . generalExp RRPAR
- 4 castExp: LRPAR . typename RRPAR generalExp
- Identifier shift, and go to state 6
- LRPAR shift, and go to state 2
- generalExp go to state 7
- castExp go to state 4
- variable go to state 5
- typename go to state 8
- State 3
- 0 $accept: generalExp . $end
- $end shift, and go to state 9
- State 4
- 3 generalExp: castExp .
- $default reduce using rule 3 (generalExp)
- State 5
- 1 generalExp: variable .
- $default reduce using rule 1 (generalExp)
- State 6
- 5 variable: Identifier .
- 6 typename: Identifier .
- RRPAR reduce using rule 5 (variable)
- RRPAR [reduce using rule 6 (typename)]
- $default reduce using rule 5 (variable)
- State 7
- 2 generalExp: LRPAR generalExp . RRPAR
- RRPAR shift, and go to state 10
- State 8
- 4 castExp: LRPAR typename . RRPAR generalExp
- RRPAR shift, and go to state 11
- State 9
- 0 $accept: generalExp $end .
- $default accept
- State 10
- 2 generalExp: LRPAR generalExp RRPAR .
- $default reduce using rule 2 (generalExp)
- State 11
- 4 castExp: LRPAR typename RRPAR . generalExp
- Identifier shift, and go to state 1
- LRPAR shift, and go to state 2
- generalExp go to state 12
- castExp go to state 4
- variable go to state 5
- State 12
- 4 castExp: LRPAR typename RRPAR generalExp .
- $default reduce using rule 4 (castExp)
Advertisement
Add Comment
Please, Sign In to add comment