420 views
4 votes
4 votes

Which of the following statements regarding $LR(0)$ parser is/are FALSE? (Mark all the appropriate choices)

  1. A $LR(0)$ configurating set cannot have multiple reduce items
  2. A $LR(0)$ configurating set cannot have both shift as well as reduce items
  3. If a reduce item is present in a $LR(0)$ configurating set it cannot have any other item
  4. An $LR(0)$ parser can parse any regular grammar

1 Answer

3 votes
3 votes
Options A,B,C are TRUE.

No grammar with empty production can be LR(0). But empty rules are allowed in regular grammar as the only condition for a grammar to be regular is to be either left linear or right linear. So, not all regular grammars are $LR(0)$ and hence not all regular grammars can be parsed by an $LR(0)$ parser.

So, correct option D.
Answer:

Related questions

4 votes
4 votes
1 answer
3
gatecse asked Dec 14, 2020
166 views
When we merge states in an $LR(1)$ parser to form an $LALR(1)$ parser, we may introduceshift-reduce conflictreduce-reduce conflictneither shift-reduce nor reduce-reduce c...
5 votes
5 votes
1 answer
4
gatecse asked Dec 14, 2020
212 views
Suppose we have a rightmost derivation which proceeds as follows:$\begin{array}{ccc}S &\rightarrow & Aabw\\ & \rightarrow &ABw \end{array}$Which of the following is a pos...