26 views
 Consider the following grammarsG1 and G2 G1: S→ aS | ε G2: S→Sa | ε Select the correct option. 1. G1 and G2 generate different parse tree for all strings.   2. L(G1) ≠ L(G2).   3. G1 is LR(0) while G2 is not LR(0)   4. G2 is LR(0) while G1 is not LR(0)
| 26 views
0
1 is false, the empty string has the same parse tree.
2 is false, since only the direction of recursion is changing, and nothing else.

$A) \ \text{False}$ as $G_1$ and $G_2$ both have same trees for $\large \epsilon$

$B) \ \text{False}$ both $G_1$ and $G_2$ produce the same result.

$C) \ \text{False} \$ Intital state contains $S \rightarrow \ .$ and this production in table will be in every column (action) which will be in conflict with in column of terminal $a$ where $S \rightarrow aS$ is placed.

$D) \ \text{True}$
by (505 points)
0
Will D) not contain reduce reduce conflict?
0
Which state which column?
0
In 1st state, I mean $I_{0}$
0
There is only 1 reduce move how you are getting conflicts?