Ambiguous grammar:
E -> UV | EBE | V | [E]
V -> a | b
U -> < | >
B -> ? | ! | @
Some information:
Order of precedence: ? < ! < @, with unary operators (<,>) being the highest
Binary operators ?, !, @ are right associative.
My attempt:
E -> UV | EBT | V | [E]
T -> E
V -> a | b
U -> < | >
B -> ? | B1
B1 -> ! | B2
B2 -> @
I'm not sure if I left out some corner cases during my conversion. Appreciate if you guys can point some mistakes out and offer some hints.