Compiler Design MCQ Questions And Answers - Parsing

This section focuses on "Parsing" in Compiler Design. These Multiple Choice Questions (MCQ) should be practiced to improve the Compiler Design skills required for various interviews (campus interviews, walk-in interviews, company interviews), placements, entrance exams and other competitive examinations.

1. In how many types parsing is divided?

A. 2
B. 3
C. 4
D. 5

View Answer


2. When the parser starts constructing the parse tree from the start symbol and then tries to transform the start symbol to the input, it is called?

A. bottom-up parsing
B. top-down parsing
C. Both A and B
D. None of the above

View Answer


3. In ___________________, if one derivation of a production fails, the syntax analyzer restarts the process using different rules of same production

A. Bottom-up Parsing
B. Recursive descent parsing
C. Backtracking
D. All of the above

View Answer


4. A form of recursive-descent parsing that does not require any back-tracking is known as?

A. predictive parsing
B. non-predictive parsing
C. recursive parsing
D. non-recursive parsing

View Answer


5. Compute E.value for the root of the parse tree for the expression:2 # 3 & 5 # 6 &4.

A. 40
B. 80
C. 120
D. 160

View Answer


6. Assume that the SLR parser for a grammar G has n1 states and the LALR parser for G has n2 states.

A. n1 is necessarily less than n2
B. n1 is necessarily equal to n2
C. n1 is necessarily greater than n2
D. None of the above

View Answer


7. the predictive parser puts some constraints on the grammar and accepts only a class of grammar known as LL(k) grammar.

A. TRUE
B. FALSE
C. Can be true or false
D. Can not say

View Answer


8. Which of the following suffices to convert an arbitrary CFG to an LL(1) grammar?

A. Removing left recursion only
B. Factoring the grammar alone
C. Factoring & left recursion removal
D. None of the above

View Answer


9. Which of the following derivations does a top-down parser use while parsing an input string?

A. Leftmost derivation
B. Leftmost derivation in reverse
C. Rightmost derivation
D. Rightmost derivation in reverse

View Answer


10. Relocation is the process of replacing symbolic references or names of libraries with actual usable addresses in memory before running a program.

A. TRUE
B. FALSE
C. Can be true or false
D. Can not say

View Answer





Discussion



* You must be logged in to add comment.