69
38
People often say that LR(k) parsers are more powerful than LL(k) parsers. These statements are vague most of the time; in particular, should we compare the classes for a fixed $k$ or the union over all $k$? So how is the situation really? In particular, I am interested in how LL(*) fits in.
As far as I know, the respective sets of grammars LL and LR parsers accept are orthogonal, so let us talk about the languages generated by the respective sets of grammars. Let $LR(k)$ denote the class of languages generated by grammars that can be parsed by an $LR(k)$ parser, and similar for other classes.
I am interested in the following relations:
- $LL(k) \overset{?}{\subseteq} LR(k)$
- $\bigcup_{i=1}^{\infty} LL(k) \overset{?}{\subseteq} \bigcup_{i=1}^{\infty} LR(k)$
- $\bigcup_{i=1}^{\infty} LL(k) \overset{?}{=} LL(*)$
- $LL(*) \overset{?}{\circ} \bigcup_{i=1}^{\infty} LR(k)$
Some of these are probably easy; my goal is to collect a "complete" comparison. References are appreciated.
2
Maybe this can help you! Grammar Hierarchy image
– Andrea Tucci – 2012-07-11T15:32:29.1301@AndreaTucci: Yes, but that only covers the grammars, not the generated languages. – Raphael – 2012-07-11T18:06:20.200