Explore topic-wise MCQs in Compilers.

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

1.

Assume statements S1 and S2 defined as: S1: L2-L1 is recursive enumerable where L1 and L2 are recursive and recursive enumerable respectively. S2: The set of all Turing machines is countable. 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» C. Both S1 and S2 are not correct
2.

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
3.

The language accepted by a Push down Automata:

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

Semantic Analyser is used for?

A. Generating Object code
B. Maintaining symbol table
C. Generating Object code & Maintaining symbol table
D. None of the mentioned
Answer» D. None of the mentioned
5.

What does a Syntactic Analyser do?

A. Maintain Symbol Table
B. Collect type of information
C. Create parse tree
D. None of the mentioned
Answer» D. None of the mentioned
6.

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
7.

Give a production grammar for the language L = {x/x ? (a,b)*, the number of a's in x is multiple of 3}.

A. {S->bS, S->b,S->aA, S->bA, A->aB, B->bB, B->aS, S->a}
B. {S->aS,S->bA,A->bB,B->bBa,B->bB}
C. {S->aaS,S->bbA,A->bB,B->ba}
D. None of the mentioned
Answer» B. {S->aS,S->bA,A->bB,B->bBa,B->bB}
8.

Let R1 and R2 be regular sets defined over alphabet ? then

A. R1 UNION R2 is regular
B. R1 INTERSECTION R2 is regular
C. ? INTERSECTION R2 IS NOT REGULAR
D. R2* IS NOT REGULAR
Answer» B. R1 INTERSECTION R2 is regular
9.

Regular expression x/y denotes the set

A. {x,y}
B. {xy}
C. {x}
D. {y}
Answer» B. {xy}
10.

Which of these does not belong to CFG

A. Terminal Symbol
B. Non terminal Symbol
C. Start symbol
D. End Symbol
Answer» E.
11.

In Right-Linear grammars, all productions have the form: A -> xB

A. True
B. False
Answer» B. False
12.

S -> abS S -> a is which grammar

A. Right Linear Grammar
B. Left Linear Grammar
C. Right & Left Linear Grammar
D. None of the mentioned
Answer» B. Left Linear Grammar
13.

S -> SS S -> ? S -> aSb S -> bSa which type of grammar is it?

A. Linear
B. Nonlinear
C. Both of the mentioned
D. None of the mentioned
Answer» B. Nonlinear
14.

The regular expressions denote zero or more instances of an x or y is

A. (x+y)
B. (x+y)*
C. (x* + y)
D. (xy)*
Answer» C. (x* + y)
15.

Which Type of Grammar is it?S -> Aa A -> Aab | ?

A. Right Linear
B. Left Linear
C. None of the mentioned
D. Right & Left Linear
Answer» C. None of the mentioned
16.

Transition of finite automata is

A. Finite Diagram
B. State Diagram
C. Node Diagram
D. E-R Diagram
Answer» C. Node Diagram
17.

Grammars that can be translated to DFAs :

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

A Push Down Automata is if there is at most one transition applicable to each configuration?

A. Deterministic
B. Non deterministic
C. Finite
D. Non finite
Answer» B. Non deterministic