Show LR0 construction for grammarSolutionLR means Left to Ri
Show LR(0) construction for grammar
Solution
LR means Left to Right to produce right most derivation. An LR(0) machine only works when the actions are reduced to single reduce action.
This machine gives grammar with complexity and construction gives states with shift/reduce reduce/reduce conflicts.
L -> L, S this condition is satisfied and ok for the LR(0)
The same in the shift/reduce state -
L ->L,S.
S->S.,L
Also look at reduce/reduce
L ->S, L.
L ->S.
To construct the grammar:
Let us say G is a grammar of LR(0)
Starting symbol is present on the left side not right side of any production.
For all prefixes like gama of G where A -> Alpha is unique
 

