How to identify whether a grammar is LL(1), LR(0) or SLR(1)?

To check if a grammar is LL(1), one option is to construct the LL(1) parsing table and check for any conflicts. These conflicts can be FIRST/FIRST conflicts, where two different productions would have to be predicted for a nonterminal/terminal pair. FIRST/FOLLOW conflicts, where two different productions are predicted, one representing that some production should be … Read more

Difference between an LL and Recursive Descent parser?

LL is usually a more efficient parsing technique than recursive-descent. In fact, a naive recursive-descent parser will actually be O(k^n) (where n is the input size) in the worst case. Some techniques such as memoization (which yields a Packrat parser) can improve this as well as extend the class of grammars accepted by the parser, … Read more

tech