Explore topic-wise MCQs in Compilers.

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

1.

Given the following statements: (i) Recursive enumerable sets are closed under complementation. (ii) Recursive sets are closed under complements. Which is/are the correct statements?

A. I only
B. II only
C. Both I and II
D. Neither I nor II
Answer» C. Both I and II
2.

Which of the following language accepted by a Push down Automata?

A. Type0
B. Type1
C. Type2
D. Type3
Answer» D. Type3
3.

Grammars that can be translated to DFAs is ___________

A. Left linear grammar
B. Right linear grammar
C. Generic grammar
D. All of the mentioned
Answer» C. Generic grammar
4.

Automaton accepting the regular expression of any number of a’ s is ___________

A. a*b) ab*c) (a/
B. ab*
C. (a/b)*
D. a*b*c
Answer» B. ab*
5.

Grammar that produce more than one Parse tree for same sentence is ___________

A. Ambiguous
B. Unambiguous
C. Complementation
D. Concatenation Intersection
Answer» B. Unambiguous
6.

Recursively enumerable languages are not closed under ______________

A. Union
B. Intersection
C. Complementation
D. Concatenation
Answer» D. Concatenation
7.

Consider the grammar given below E? E+E | E*E | E-E | E/E | E^E | (E) | id Assume that + and ^ have the same but least precedence, * and / have the next higher precedence but the same precedence and finally ^ has the highest precedence. Assume + and ^ associate to the left like * and / and that ^ associates to the right. Choose the correct for the ordered pairs (^,^), (-,-), (+,+), (*,*) in the operator precedence table constructed for the grammar.

A. All <
B. All >
C. < >, =
D. < > > >
Answer» E.
8.

If P & R are regular and also given that if PQ=R, then?

A. Q has to be regular
B. Q cannot be regular
C. Q need not be regular
D. Q has to be a CFL
Answer» D. Q has to be a CFL
9.

Assume the statements S1 and S2 given as:S1: Given a context free grammar, there exists an algorithm for determining whether L (G) is infinite.S2: There exists an algorithm to determine whether two context free grammars generate the same language.Which of the following is true?

A. S1 is correct and S2 is not correct
B. Both S1 and S2 are correct
C. Both S1 and S2 are not correct
D. S1 is not correct and S2 is correct
Answer» B. Both S1 and S2 are correct