recategorized by
3,591 views
10 votes
10 votes

Consider the following grammar:

  • $S \rightarrow S$
  • $S \rightarrow SS \mid a \mid \epsilon$

Construct the collection of sets of $\text{LR (0)}$ items for this grammar and draw its goto graph.

recategorized by

2 Answers

Best answer
14 votes
14 votes

The augmented production is $S^{'} \rightarrow S$.

$\textbf{GOTO Graph:}$

Here, each of $I_0$, $I_1$, $I_2$, $I_3$ is a set of $LR(0)$ items. And hence $I_0$, $I_1$, $I_2$, $I_3$ are the collection of sets of $LR(0)$ items.

selected by
1 votes
1 votes

Augmented production S'-->S

 

reshown by

Related questions

4 votes
4 votes
2 answers
1
go_editor asked Dec 19, 2016
2,151 views
Consider the following grammar:$S \rightarrow S$$S \rightarrow SS \mid a \mid \epsilon$Indicate the shift-reduce and reduce-reduce conflict (if any) in the various states...
8 votes
8 votes
1 answer
4
go_editor asked Dec 19, 2016
2,409 views
Construct a DAG for the following set of quadruples:E:=A+BF:=E-CG:=F*DH:=A+BI:=I-CJ:=I+G