1,134 views
2 votes
2 votes
which of the following statements is true?

A) right recursion is needed for termination in predictive parser

B) left recursion is required more stack space than right recursion

C) left recursion works fine in BUP

1)A & B

2) A & C
3) B & C
4) All

2 Answers

0 votes
0 votes

A and C are correct.

1)In predictive parser we use right recursive and deterministic grammer and do top down parsing. So by using RR chance of infinite recursion is avoided. So its true.

2) Actually its the other way around. right recursive grammars, the stack may grow indefinitely until a reduction occurs, thus limiting rather dramatically the parsing possibilities. However, left recursive ones will let the compiler generate reductions earlier (in fact, as soon as possible). So its false. 

3) Yes, Its the advantage of BUP actually. http://jeffreykegler.github.io/Ocean-of-Awareness-blog/individual/2014/11/ll.html

0 votes
0 votes
i think B and C are true .but , B is absolutly fine its correct there is no doubt in that .

option A is FALSE because in order to stop an PARSER we need EPSILON  but not an RIGHT /LEFT  RECURSIVE GRAMMAR

Related questions

0 votes
0 votes
2 answers
1
dhruba asked Jun 5, 2023
332 views
0 votes
0 votes
1 answer
3
Kartheek8899 asked Oct 14, 2022
545 views
S - L = RS - RL - * RL - idR - LIs given CFG LR(0) & SLR(1)?
0 votes
0 votes
2 answers
4
atulcse asked Jan 16, 2022
907 views
Consider the following context-free grammar:Find the number of unique productions in {Goto (A → D.BC, B) U Goto (A → .DBC, D)}