COMPILER DESIGN

TOOLS AND TECHNIQUES FOR COMPILER DESIGN

MISCELLENOUS

Question [CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
____ parsing methods cannot handle left recursion
A
Bottom-up
B
Top-down
C
Both the options
D
None of the mentioned
Explanation: 

Detailed explanation-1: -In short, top-down parsers usually try to guess what to do from limited information about the string. Because of this, they get confused by left recursion because they can’t always accurately predict which productions to use. Hope this helps!

Detailed explanation-2: -It cannot handle left-recursion because it is a top-down parsing technique, and top-down parsers cannot handle left recursion. This is because in left recursion, for a rule conforming to: A-> A | , the starting symbol is repeated immediately after the arrow; making the derivation refer to itself infinitely times.

Detailed explanation-3: -Recursive descent is a top-down parsing technique that constructs the parse tree from the top and the input is read from left to right. It uses procedures for every terminal and non-terminal entity. This parsing technique recursively parses the input to make a parse tree, which may or may not require back-tracking.

There is 1 question to complete.