Compiler Construction MCQ :Syntax Analysis(Parser)-Recursive Descent Parsing , LL(1), FIRST & FOLLOW : Link3

Compiler Construction MCQ :Syntax Analysis(Parser)-Recursive Descent Parsing , LL(1), FIRST & FOLLOW : Link3

Compiler Construction MCQ & Answers

       Are you worried about the answers to Compiler Construction questions :Recursive Descent Parsing , LL(1), FIRST & FOLLOW? We have arranged the Show Answer button under the each question. Candidates can click on it to know the right option among the given alternatives. Furthermore, the applicants can check our web portal @ www.totalmcq.com to take part in more MCQ on various subject. Wish, the given information about the Compiler Construction MCQ will helpful to the advance and can learn the various types of questions and answers.


Q.1. The grammar S → aSa | bS | c is-------

A. LL(1) but not LR(1)                                                   B. LR(1) but not LR(1)
C. Both LL(1) and LR(1)                                                D. Neither LL(1) nor LR(1)

Q.2. Consider the following grammar:
S → FR
R → S | ε
F → id
In the predictive parser table, M, of the grammar the entries M[S, id] and M[R, $] respectively.

A. {S → FR} and {R → ε }                                               B. {S → FR} and { }
C. {S → FR} and {R → *S}                                             D. {F → id} and {R → ε}

Q.3. The grammar A → AA | (A) | ε is not suitable for predictive-parsing because the grammar is---------

A. left-recursive                                                           B. right-recursive
C. ambiguous                                                                D. an operator-grammar

Q.4. Predictive parser can be ?

A. Recursive                                                                   B. Constructive
C. Non recursive                                                           D. Both A and B

Q.5. Which of the following is NOT a bottom up, shift reduce parser?

A. LL parser                                                                    B. LR parser
C. SLR parser                                                                 D. LALR parser

Q.6. The parsing technique that avoids backtracking is-------

A. Recursive Descent Parsing                                      B. Predictive Parsing
C. Syntax tree                                                                D. Top-down parsing

Q.7. Which of the following is true for a predictive parser?

A. Recursive Descent parser                                                     B. no backtracking
C. Recursive Descent parser and no backtracking                D. None of the above.

Q.8. Calculate the First(D) and Follow(B) functions for the given grammar-
S → aBDh
B → cC
C → bC / ∈
D → EF
E → g / ∈
F → f / ∈

A. First(D)={ g , f , ∈ } & Follow(B)= { g , f , h }
B. First(D)={ g , ∈ } & Follow(B)= { g , ∈ }
C. First(D)={ g , f , ∈ } & Follow(B)= { g , f }
D. First(D)={ g , f } & Follow(B)= { g , f , h }

Q.9. Calculate the First(S) and Follow(A) functions for the given grammar-
S → AaAb / BbBa
A → ∈
B → ∈

A] First(S)={ a, ∈ } and Follow(A)={ a, b }
B] First(S)={ a, b } and Follow(A)={ a, b }
C] First(S)={∈, ∈ } and Follow(A)={ a, b }
D] First(S)={ a, b } and Follow(A)={ a, ∈ }

Q.10. Predictive parser can be constructed for class of--------grammar.

A. LL(1)                                                                          B. LR(1)
C. CLR(1)                                                                       D. LALR(1).

Q.11. State True or False. "LL(1) grammar cannot be ambiguous."

A. True                                                                           B. False

Q.12. Findout First and Follow of following grammar
S→A |a
|A→a

A. First(S)={a} ,First(A)={a} , Follow(S)={$} , Follow(A)={$}
B. First(S)={a} ,First(A)={a} , Follow(S)={$} , Follow(A)={a}
C. First(S)={a} ,First(A)={a} , Follow(S)={a} , Follow(A)={$}
D. First(S)={$} ,First(A)={$} , Follow(S)={a} , Follow(A)={a}

Q.13. A graphical representation for derivations that filter out the choice regarding replacement order is called the ---------.

A. graph tree                                                               B. syntax tree
C. parse tree                                                                D. symbol tree

Q.14. A parser for Grammar G is a program that takes as input string W and produces as output is ------- for W.

A. parse tree                                                                B. error message
C. string                                                                        D. None of the above.

Q.15. In a top-down parser, the starting --------is expanded to derive the given input string.

A. terminal                                                                    B. letter
C. digit                                                                          D. non-terminal