Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Created by PLY version 3.9 (http://www.dabeaz.com/ply)
- Grammar
- Rule 0 S' -> expression
- Rule 1 expression -> expression LT expression
- Rule 2 expression -> expression LPAREN RPAREN
- Rule 3 expression -> NAME
- Terminals, with rules where they appear
- LPAREN : 2
- LT : 1
- NAME : 3
- RPAREN : 2
- error :
- Nonterminals, with rules where they appear
- expression : 1 1 2 0
- Parsing method: LALR
- state 0
- (0) S' -> . expression
- (1) expression -> . expression LT expression
- (2) expression -> . expression LPAREN RPAREN
- (3) expression -> . NAME
- NAME shift and go to state 2
- expression shift and go to state 1
- state 1
- (0) S' -> expression .
- (1) expression -> expression . LT expression
- (2) expression -> expression . LPAREN RPAREN
- LT shift and go to state 4
- LPAREN shift and go to state 3
- state 2
- (3) expression -> NAME .
- LT reduce using rule 3 (expression -> NAME .)
- LPAREN reduce using rule 3 (expression -> NAME .)
- $end reduce using rule 3 (expression -> NAME .)
- state 3
- (2) expression -> expression LPAREN . RPAREN
- RPAREN shift and go to state 5
- state 4
- (1) expression -> expression LT . expression
- (1) expression -> . expression LT expression
- (2) expression -> . expression LPAREN RPAREN
- (3) expression -> . NAME
- NAME shift and go to state 2
- expression shift and go to state 6
- state 5
- (2) expression -> expression LPAREN RPAREN .
- LT reduce using rule 2 (expression -> expression LPAREN RPAREN .)
- LPAREN reduce using rule 2 (expression -> expression LPAREN RPAREN .)
- $end reduce using rule 2 (expression -> expression LPAREN RPAREN .)
- state 6
- (1) expression -> expression LT expression .
- (1) expression -> expression . LT expression
- (2) expression -> expression . LPAREN RPAREN
- LT reduce using rule 1 (expression -> expression LT expression .)
- LPAREN reduce using rule 1 (expression -> expression LT expression .)
- $end reduce using rule 1 (expression -> expression LT expression .)
- ! LT [ shift and go to state 4 ]
- ! LPAREN [ shift and go to state 3 ]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement