How to turn a Grammar to LR(0)

68 Views Asked by At

Is there a general algorithm that turns a given grammar into LR(0) grammar?

I tried turning the grammar into CNF but even when I succeeded it didnt work out to be LR0

1

There are 1 best solutions below

0
rici On

No.

There are lots of languages which are not LR(0); meaning that no LR(0) grammar exists.

CNF is irrelevant. It does not generally create determinism.