COMPILER DESIGN

SYNTAX ANALYSIS

ROLE OF THE PARSER

Question [CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
Consider the following statements:S1:Every regular grammar is LL(1).S2:If a grammar is ambiguous then it cannot be parsed by any of the parser.S3:If a grammar is left factored, then after removal of left factoring, the grammar becomes LL(1).S4:If a grammar is left recursive, then after removal of left recursion, the grammar becomes LL(1).Which option is correct?
A
All statements are TRUE
B
Only S1, S2, and S4 are TRUE
C
Only S1, S3 and S4 are FALSE
D
Only S1, S2 and S3 are TRUE
Explanation: 

Detailed explanation-1: -We also know every regular language is also a regular grammar. Therefore, every regular grammar is also a context free grammar. Since CFGs can be abmbiguous, therefore by logic, some regular grammars can be ambiguous.

Detailed explanation-2: -A Grammar G (V, T, P, S) is left recursive if it has a production in the form. A → A |. Left Recursion can be eliminated by introducing new non-terminal A such that. This type of recursion is also called Immediate Left Recursion.

There is 1 question to complete.