Explore topic-wise MCQs in Compilers.

This section includes 4 Mcqs, each offering curated multiple-choice questions to sharpen your Compilers knowledge and support exam preparation. Choose a topic below to get started.

1.

ITEMS_CORRESPONDING_TO_THE_GRAMMAR_ABOVE?$

A. S -> S * .E
B. E -> F . + E
C. E -> F + .E
Answer» C. E -> F + .E
2.

What precedence and associativity properties does the generated parser realize?

A. Equal precedence and left associativity; expression is evaluated to 7
B. Equal precedence and right associativity, expression is evaluated to 9
C. Precedence of ‘x’ is higher than that of ‘+’, and both operators are left associative; expression is evaluated to 7
D. Precedence of ‘ ‘ is higher than that of ‘’, and both operators are left associative; expression is evaluated to 9
Answer» D. Precedence of ‚Äö√Ñ√∂‚àö√ë‚àö‚â§ ‚Äö√Ñ√∂‚àö√ë‚àö‚â§ is higher than that of ‚Äö√Ñ√∂‚àö√ë‚àö‚â§‚Äö√Ñ√∂‚àö√ë‚àö¬•, and both operators are left associative; expression is evaluated to 9
3.

S -> (S)| a

A. , LR(1) and LALR(1) parsers for the grammar n1 n2 and n3 respectively.
B. n1 < n2 < n3
C. n1 = n3 < n2
D. n1 = n2 = n3
Answer» C. n1 = n3 < n2
4.

The grammar A ->AA |( A)| ε

A.
B. Ambiguous
C. Left-recursive
Answer» B. Ambiguous