I've an exercise in which I have LR(2) grammar and I want to transform in LR(1) grammar. But I don't see how I can do that. I've this grammar (4 rules) :
- e -> true | false | id | e ^ e | e v e | (e)
- i -> if e then i | if e then i else i | id = e | (i) | ma
- ma -> a | a ^ ma
- a -> id = e
The problem with this grammar that she produces a reduce/reduce conflict (nobody likes that). So I need to change this grammar in LR(1) but I really don't see the algorithm for to do that. Help please :)