Question:

Consider the following augmented grammar with terminals {#, @, <, >, a, b, c}.

$S' → S$
$S → S\#cS$
$S → SS$
$S → S@$
$S → <S>$
$S → a$
$S → b$
$S → c$

Let I0 = CLOSURE({ S' → • S }). The number of items in the set GOTO(GOTO(I0, <), <) is  .

Show Hint

In LR parsing, always apply CLOSURE after each GOTO to count all reachable items.
Updated On: Dec 30, 2025
Hide Solution
collegedunia
Verified By Collegedunia

Correct Answer: 8

Solution and Explanation

From \( I_0 \), applying \( \text{GOTO}(I_0, <) \) introduces items where the dot moves past terminal \( < \).
This produces the item: \[ S \rightarrow < \bullet S > \] Taking closure of this item introduces all productions of \( S \) with the dot at the beginning.
Now applying \( \text{GOTO} \) again on terminal \( < \) shifts the dot past the second \( < \), producing a similar set of items.
Counting all distinct LR(0) items obtained in this process gives a total of: \[ 8 \] Final Answer: \[ \boxed{8} \]
Was this answer helpful?
0
0

Top Questions on Parsing