Compiler Design (2170701) MCQs

MCQs of Parsing Theory

Showing 11 to 19 out of 19 Questions
11.

Given an NFA with N states, the maximum number of states in an equivalent minimized DFA is at least

(a)

n2

(b)

2n

(c)

2n

(d)

n!

Answer:

Option (b)

12.

Type checking is normally done during ____________

(a)

Lexical Analysis

(b)

Syntax Analysis

(c)

 Syntax Directed Translation

(d)

Code generation

Answer:

Option (c)

13.

The Grammar {S->aSbb,S->abb} is __________ grammar.

(a)

Type-3

(b)

Type-2

(c)

Type-1

(d)

Type-0

Answer:

Option (b)

14.

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

(a)

An equal number of 0’s and 1’s

(b)

The unequal number of 0’s and 1’s

(c)

Number of 0’s followed by any number of 1’s

(d)

None of the mentioned

Answer:

Option (a)

15.

Which of the following parser is most powerful? 

(a)

Operator precedence

(b)

Canonical LR

(c)

LALR

(d)

SLR

Answer:

Option (b)

16.

Consider the following expression grammar G.

E -> E - T | T

T -> T + F | F

F -> (E) | id

Which of the following grammars are not left recursive, but equivalent to G.

(a)

E -> E - T | T

T -> T + F | F

F -> (E) | id

(b)

E -> TE'

E' -> -TE' | ε

T -> T + F | F

F -> (E) | id

(c)

E -> TX

X -> -TX | ε

T -> FY

Y -> +FY | ε

F -> (E) | id

(d)

E -> TX | (TX)

X -> -TX | +TX | ε

T -> id

Answer:

Option (c)

17.

what is the FOLLOW of start symbol in given grammar?

S->aB | ϵ

B->bC | ϵ

C->cS | ϵ

(a)

a

(b)

b

(c)

c

(d)

$

Answer:

Option (d)

18.

Value of synthesized attribute at a node can be computed from the value of attributes at the _______of that node in the parse tree.

(a)

Children

(b)

Parent

(c)

Sibling

(d)

All of these

Answer:

Option (a)

19.

Which of the following grammar rules violate the requirements of an operator grammar?

(i) P -> QR

(ii) P -> QsR

(iii) P -> ε

(iV) P -> QtRr

 

(a)

(i) only

(b)

(i) and (iii) only

(c)

(ii) and (iii) only

(d)

(iii) and (iv) only

Answer:

Option (b)

Showing 11 to 19 out of 19 Questions