So I am in the process of learning about LL(1) grammar and converting an ambiguous one into LL(1). I know how to figure out if a grammar (G) is ambiguous, however, I am having trouble converting it to a LL(1) using left factoring.From my understanding, left factoring is basically factoring out prefixes which are common to two or more productions. So for example,  A -> X | X Y ZBecomesA -> X BB -> Y Z |  However, if we take an example such as the following grammar G, A -> acB | daB -> abB | daA | AfHow would I go about applying the left factoring to convert G to LL(1) since there is no common prefix based on what I can see. I am assuming I would have to use substitution (right corner substitution), correct?The following is my attempt at converting G to LL(1), did I do it correctly?A -> acB | daB -> abB | daA | AfA -> acabB | daA | Af | da     //sub B into AA -> E | Af | da               //left factorE -> acabB | daA | 1
Converting Ambiguous Grammar G to LL(1)
formal languages;formal grammars;compilers;parsers;factoring