edited by
611 views
1 votes
1 votes

Which of the following statements are $\text{TRUE}$?

  1. Top-down parsers are equipped to handle left recursive grammar.
  2. $\text{LALR}$ parser is more powerful than an $\text{SLR}$ parser
  3. Recursive descent parsing is an example of top-down parsing.
  1. $\text{III}$ only
  2. $\text{I}$ only
  3. $\text{II}$ only
  4. $\text{II}$ and $\text{III}$
edited by

2 Answers

0 votes
0 votes

I. Non Recursive descentparser(LL(1)) fails with Left recursive as it might lead to infinite loop,So False.

 

II.Parser according to power: CLR  > LALR > SLR  So True.

 

III.Recursive descent parsing is an example of Top Down parser. True.

 

Hence D is correct option.

0 votes
0 votes
LALR parser is more powerful than SLR(1).

Recursive Descent Parser is top down parsing which uses backtracking and uses os stack instead of parser stack

Top down parsers doesn't handle left recursion because there is a problem of halting (may go to infinite loop)
Answer:

Related questions

0 votes
0 votes
1 answer
2
admin asked Jan 5, 2019
364 views
The following grammar $\text{G}$ is left recursive.$\text{E} \rightarrow \text{E + T}\; \mid \; \text{T} $$\text{T} \rightarrow \text{T * F} \; \mid \; \text{F} $$\text{F...
1 votes
1 votes
0 answers
3
admin asked Jan 5, 2019
262 views
Match all items in Group $1$ with correct options from those given in Group $2.$$$\begin{array} {|l|l|} \hline \qquad \qquad \textbf{Group 1} & \qquad \textbf{Group 2} \\...
1 votes
1 votes
0 answers
4
admin asked Jan 5, 2019
272 views
Which phase during compilation does a compiler recognize the $\textbf{keywords}$ of a language?Code generationParsingDataflow analysisLexical analysis