Grammar
A → A ( B A )
| .
B → B *( A B )*
| .
LR(0) Table
$)**()(AB
0 r(A → ε) r(A → ε) r(A → ε) r(A → ε) r(A → ε) s1  
1 acc acc acc acc acc/s2    
2 r(B → ε) r(B → ε) r(B → ε) r(B → ε) r(B → ε)   s3
3 r(A → ε) r(A → ε) r(A → ε)/s5 r(A → ε) r(A → ε) s4  
4       s7 s2    
5 r(A → ε) r(A → ε) r(A → ε) r(A → ε) r(A → ε) s6  
6 r(B → ε) r(B → ε) r(B → ε) r(B → ε) r(B → ε)/s2   s8
7 r(AA ( B A )) r(AA ( B A )) r(AA ( B A )) r(AA ( B A )) r(AA ( B A ))    
8   s9 s5        
9 r(BB *( A B )*) r(BB *( A B )*) r(BB *( A B )*) r(BB *( A B )*) r(BB *( A B )*)    

SLR(1) Table
$)**()(AB
0 r(A → ε) r(A → ε) r(A → ε) r(A → ε) r(A → ε) s1  
1 acc       s2    
2   r(B → ε) r(B → ε) r(B → ε) r(B → ε)   s3
3 r(A → ε) r(A → ε) r(A → ε)/s5 r(A → ε) r(A → ε) s4  
4       s7 s2    
5 r(A → ε) r(A → ε) r(A → ε) r(A → ε) r(A → ε) s6  
6   r(B → ε) r(B → ε) r(B → ε) r(B → ε)/s2   s8
7 r(AA ( B A )) r(AA ( B A )) r(AA ( B A )) r(AA ( B A )) r(AA ( B A ))    
8   s9 s5        
9   r(BB *( A B )*) r(BB *( A B )*) r(BB *( A B )*) r(BB *( A B )*)    

The grammar is not LR(0) because:
  • shift/reduce conflict in state 1.
  • shift/reduce conflict in state 3.
  • shift/reduce conflict in state 6.
Neither is it SLR(1) because:
  • shift/reduce conflict in state 3.
  • shift/reduce conflict in state 6.


Return home to enter a new grammar.