| 1 |
|
| 2 |
Production Rules: |
| 3 |
1: start -> start expr |
| 4 |
2: start -> <empty> |
| 5 |
3: expr -> NR |
| 6 |
4: expr -> expr '+' expr |
| 7 |
5: start_$ -> start |
| 8 |
|
| 9 |
|
| 10 |
Symbolic Terminal tokens: |
| 11 |
error |
| 12 |
EOF |
| 13 |
257: NR |
| 14 |
43: '+' |
| 15 |
|
| 16 |
|
| 17 |
FIRST sets: |
| 18 |
start: { NR <e> } |
| 19 |
expr: { NR } |
| 20 |
start_$: { NR <e> } |
| 21 |
|
| 22 |
|
| 23 |
FOLLOW sets: |
| 24 |
start: { NR <EOF> } |
| 25 |
expr: { NR '+' <EOF> } |
| 26 |
start_$: { <EOF> } |
| 27 |
|
| 28 |
|
| 29 |
Grammar States: |
| 30 |
|
| 31 |
For each state information like the following is shown for its items: |
| 32 |
0: [P1 1] S -> C . C { <EOF> } 0 |
| 33 |
which should be read as follows: |
| 34 |
0: The item's index |
| 35 |
[P1 1]: The rule (production) number and current dot-position |
| 36 |
S -> C . C: The item (lhs -> Recognized-symbols . symbols-to-recognize) |
| 37 |
{ <EOF> } The item's lookahead (LA) set |
| 38 |
0 The next-element (shown below the items) describing the |
| 39 |
action associated with this item (-1 for reducible items) |
| 40 |
|
| 41 |
The Next tables show entries like: |
| 42 |
0: On C to state 5 with (0 ) |
| 43 |
meaning: |
| 44 |
0: The Next table's index |
| 45 |
On C to state 5: When C was recognized, continue at state 5 |
| 46 |
with (0 ) The item(s) whose dot is shifted at the next state |
| 47 |
Also, reduction item(s) may be listed |
| 48 |
|
| 49 |
|
| 50 |
State 0: |
| 51 |
0: [P5 0] start_$ -> . start { <EOF> } 0 |
| 52 |
1: [P1 0] start -> . start expr { NR <EOF> } 0 |
| 53 |
2: [P2 0] start -> . { NR <EOF> } 1, () -1 |
| 54 |
0: On start to state 1 with (0 1 ) |
| 55 |
Reduce item(s): 2 |
| 56 |
|
| 57 |
|
| 58 |
State 1: |
| 59 |
0: [P5 1] start_$ -> start . { <EOF> } -1 |
| 60 |
1: [P1 1] start -> start . expr { NR <EOF> } 0 |
| 61 |
2: [P3 0] expr -> . NR { NR '+' <EOF> } 1 |
| 62 |
3: [P4 0] expr -> . expr '+' expr { NR '+' <EOF> } 0 |
| 63 |
0: On expr to state 2 with (1 3 ) |
| 64 |
1: On NR to state 3 with (2 ) |
| 65 |
|
| 66 |
|
| 67 |
State 2: |
| 68 |
0: [P1 2] start -> start expr . { NR <EOF> } -1 |
| 69 |
1: [P4 1] expr -> expr . '+' expr { NR '+' <EOF> } 0 |
| 70 |
0: On '+' to state 4 with (1 ) |
| 71 |
Reduce item(s): 0 |
| 72 |
|
| 73 |
|
| 74 |
State 3: |
| 75 |
0: [P3 1] expr -> NR . { NR '+' <EOF> } -1 |
| 76 |
Reduce item(s): 0 |
| 77 |
|
| 78 |
|
| 79 |
State 4: |
| 80 |
0: [P4 2] expr -> expr '+' . expr { NR '+' <EOF> } 0 |
| 81 |
1: [P3 0] expr -> . NR { NR '+' <EOF> } 1 |
| 82 |
2: [P4 0] expr -> . expr '+' expr { NR '+' <EOF> } 0 |
| 83 |
0: On expr to state 5 with (0 2 ) |
| 84 |
1: On NR to state 3 with (1 ) |
| 85 |
|
| 86 |
|
| 87 |
State 5: |
| 88 |
0: [P4 3] expr -> expr '+' expr . { NR '+' <EOF> } -1 |
| 89 |
1: [P4 1] expr -> expr . '+' expr { NR '+' <EOF> } 0 |
| 90 |
0: |
| 91 |
Reduce item(s): 0 |
| 92 |
|
| 93 |
|
| 94 |
|