This is not exactly homework but it is related to my studies:
A grammar for example is like:
E -> E+E|E*E|-E|(E)|id
After removing ambiguity it becomes (starting from lowest precedence operator)
E->-F|F
F->F+G|G
G->G*H|H
H->(E)|id
And after removing the left recursion and left factoring (not needed in this case) the final LL1 grammar is:
E->-F|F
F->GF'
F'->+GF'|e
G->HG'
B->*HG'|e
H->(E)|id
Which gives an error free parser table which works fine. Now about the problem I am facing, suppose the grammar is like this:
E -> E+E|E*E|id=E|(E)|id
Now I am not able to generate a parsing table without conflicts, which means my final grammar is not LL1. Here are the steps:
after removing ambiguity:
E->id=F|F
F->F+G|G
G->G*H|H
H->(E)|id
And after removing the left recursion and left factoring, the grammar becomes:
E->id=F|F
F->GF'
F'->+GF'|e
G->HG'
B->*HG'|e
H->(E)|id
But there is a conflict in the Parser table that I am not able to remove, which means that there is some step that I have missed, or there is some mistake in the steps that I am not able to find. Please tell me what I have done wrong, and how to fix this. I have been working on this problem for a long time now.