|
LR(0) Table
| $ | e | c | s | S | C |
0 |
|
|
s3 |
s2 |
s1 |
|
1 |
acc |
acc |
acc |
acc |
|
|
2 |
r(S → s) |
r(S → s) |
r(S → s) |
r(S → s) |
|
|
3 |
|
|
s3 |
s2 |
s4 |
|
4 |
r(C → ε) |
r(C → ε)/s6 |
r(C → ε) |
r(C → ε) |
|
s5 |
5 |
r(S → c S C) |
r(S → c S C) |
r(S → c S C) |
r(S → c S C) |
|
|
6 |
|
|
s3 |
s2 |
s7 |
|
7 |
r(C → e S) |
r(C → e S) |
r(C → e S) |
r(C → e S) |
|
|
SLR(1) Table
| $ | e | c | s | S | C |
0 |
|
|
s3 |
s2 |
s1 |
|
1 |
acc |
|
|
|
|
|
2 |
r(S → s) |
r(S → s) |
|
|
|
|
3 |
|
|
s3 |
s2 |
s4 |
|
4 |
r(C → ε) |
r(C → ε)/s6 |
|
|
|
s5 |
5 |
r(S → c S C) |
r(S → c S C) |
|
|
|
|
6 |
|
|
s3 |
s2 |
s7 |
|
7 |
r(C → e S) |
r(C → e S) |
|
|
|
|
The grammar is not LR(0) because:
- shift/reduce conflict in state 4.
Neither is it SLR(1) because:
- shift/reduce conflict in state 4.
|