274 views
0 votes
0 votes

We suggested that individual items could be regarded as states of a nondeterministic finite automaton, while sets of valid items are the states of a deterministic finite automaton (see the box on "Items as States of an NFA" in Section $4.6.5$). For the grammar $S \rightarrow S S + \mid S S * \mid a$  of Question $4.2.1$: 

  1. Draw the transition diagram (NFA) for the valid items of this grammar according to the rule given in the box cited above.
  2. Apply the subset construction (Algorithm $3.20$) to your NFA from part $(a)$. How does the resulting DFA compare to the set of $LR(0)$ items for the grammar?
  3. Show that in all cases, the subset construction applied to the NFA that comes from the valid items for a grammar produces the $LR(0)$ sets of items.

Please log in or register to answer this question.

Related questions

0 votes
0 votes
0 answers
4
admin asked Aug 20, 2019
365 views
Construct thecanonical LR, andLALR sets of items for the grammar $S\rightarrow S S + \mid S S \ast \mid a$ of Question $4.2.1$.