2

In the context of languages (not grammars), I know following:

  1. $LL(0) \subset LL(1) \subset LL(2) \subset \cdots \subset LL(k)$
  2. $LR(0) \subset SLR(1) = LALR(1) = LR(1) = SLR(k) = LALR(k) = LR(k)$
  3. $LL(0)\subset LR(0)$
  4. $LL(n)\subset LR(1)$ for all $n$'s

How does $LL(n)$ languages compare with $LR(0)$, for $n>1$?

RajS
  • 1,667
  • 4
  • 26
  • 46

1 Answers1

1

They are incomparable.

  1. Every $LR(0)$ language has the prefix property (no sentence is a prefix of another sentence). But many $LL(k)$ languages don't have this property ($a^*$, for example).

  2. The language $\{a^nb^mc\mid n\ge m\ge 0\}$ is $LR(0)$ but is not $LL(k)$ for any $k$.

rici
  • 12,020
  • 21
  • 38