Courses

# Test: Code Generation

## 15 Questions MCQ Test Compiler Design | Test: Code Generation

Description
This mock test of Test: Code Generation for Computer Science Engineering (CSE) helps you for every Computer Science Engineering (CSE) entrance exam. This contains 15 Multiple Choice Questions for Computer Science Engineering (CSE) Test: Code Generation (mcq) to study with solutions a complete question bank. The solved questions answers in this Test: Code Generation quiz give you a good mix of easy questions and tough questions. Computer Science Engineering (CSE) students definitely take this Test: Code Generation exercise for a better result in the exam. You can find other Test: Code Generation extra questions, long questions & short questions for Computer Science Engineering (CSE) on EduRev as well by searching above.
QUESTION: 1

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

Solution:

An ambiguous grammar is one for which there is more than one parse tree for a single sentence.

QUESTION: 2

### Automaton accepting the regular expression of any number of a ‘ s is

Solution:

It gives any number of a’s.

QUESTION: 3

### Grammars that can be translated to DFAs:

Solution:

Right linear grammar can be translated to the DFAs.

QUESTION: 4

The language accepted by a Push down Automata

Solution:

A known fact that type 2 grammar is accepted by PDA.

QUESTION: 5

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 ?

Solution:

Recursive languages are closed under the following operations.
The Kleene star L * of L
the concatenation L * o P of L and P
the union L U P
the intersection L ∩ P.

QUESTION: 6

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 ?

Solution:

The assumptions of statement S1 and S2 are correct.

QUESTION: 7

A context free language is called ambiguous if

Solution:

When two or more Left and right most derivative occur the grammar turn ambiguous.

QUESTION: 8

Which of the following statement is false?

Solution:

All the statements follow the rules.

QUESTION: 9

The context free grammar S → A111|S1, A → A0 | 00 is equivalent to

Solution:

S-> A111
S->00111 (A->00)

QUESTION: 10

The context free grammar S → SS | 0S1 | 1S0 | ɛ generates

Solution:

S->SS
S->0S1S
S->0S11S0
S->0110.

QUESTION: 11

Which of the following statement is false?

Solution:

All of them are true regarding a derivation tree.

QUESTION: 12

Push down automata accepts which language

Solution:

PDA accepts CFG.

QUESTION: 13

A regular Grammar is a

Solution:

Regular grammar is CFG. It restricts its rules to a single non terminal on left hand side.

QUESTION: 14

A CFG is closed under

Solution:

CFG is closed under the above mentioned 3 operations.

QUESTION: 15

Which of these does not belong to CFG?

Solution:

CFG consist of terminal non terminal start symbol set of production rules but does not have an end symbol.