1,033 views
0 votes
0 votes

Consider the family of grammars $G_{n}$, defined by:

  • $S\rightarrow A_{i}b_{i}$ for $1\leq i\leq n$
  • $A_{i} \rightarrow a_{j} A_{i}\mid a_{j}$ for $1\leq i,j\leq n$ and $i\neq j$

Show that:

  1. $G_{n}$, has $2n^{2}-n$ productions.
  2. $G_{n}$, has $2^{n} + n^{2} + n$ sets of $LR(0)$ items.
  3. $G_{n}$ is $SLR(1)$.

What does this analysis say about how large $LR$ parsers can get?

Please log in or register to answer this question.

Related questions

0 votes
0 votes
0 answers
1
2 votes
2 votes
0 answers
2
admin asked Aug 20, 2019
365 views
Show that the following grammar:$S\rightarrow AaAb\mid BbBa$$A\rightarrow \epsilon$$A\rightarrow\epsilon$is LL(1) but not SLR(1).