Grammar
S → s
| c S C.
C → e S
| .
LR(0) Table
$ecsSC
0     s3 s2 s1  
1 acc acc acc acc    
2 r(Ss) r(Ss) r(Ss) r(Ss)    
3     s3 s2 s4  
4 r(C → ε) r(C → ε)/s6 r(C → ε) r(C → ε)   s5
5 r(Sc S C) r(Sc S C) r(Sc S C) r(Sc S C)    
6     s3 s2 s7  
7 r(Ce S) r(Ce S) r(Ce S) r(Ce S)    

SLR(1) Table
$ecsSC
0     s3 s2 s1  
1 acc          
2 r(Ss) r(Ss)        
3     s3 s2 s4  
4 r(C → ε) r(C → ε)/s6       s5
5 r(Sc S C) r(Sc S C)        
6     s3 s2 s7  
7 r(Ce S) r(Ce 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.


Return home to enter a new grammar.