The Gateway to Computer Science Excellence

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:

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

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

52,345 questions

60,501 answers

201,871 comments

95,325 users