Compiler Design (2170701) MCQs

MCQs of Lexical Analysis

Showing 1 to 10 out of 20 Questions
1.

The output of a lexical analyzer is

(a)

 Parse tree

(b)

Intermediate code

(c)

Machine code

(d)

A stream of tokens

Answer:

Option (d)

2.

Which of the following statement is true for Dead State?

(a)

It cannot be reached anytime

(b)

There is no necessity of the state

(c)

If control enters no way to come out from the state

(d)

If control enters FA deads

Answer:

Option (c)

3.

Which of the following is a not a part of 5-tuple finite automata?

(a)

 Input alphabet 

(b)

 Initial State

(c)

 Output Alphabet

(d)

 Transition function

Answer:

Option (c)

4.

Which of the following are Lexemes?

(a)

Identifiers

(b)

 Constants

(c)

 Keywords

(d)

 All of the mentioned

Answer:

Option (d)

5.

What is the Regular Expression Matching Zero or More Specific Characters?

(a)

x

(b)

#

(c)

*

(d)

&

Answer:

Option (c)

6.

Regular expression (x/y)(x/y) denotes which of the following set?

(a)

{xy,xy}

(b)

{xx,xy,yx,yy}

(c)

{x,y}

(d)

{x,y,xy}

Answer:

Option (b)

7.

An NFA’s transition function returns ________

(a)

A Boolean value

(b)

A state

(c)

A set of states

(d)

An edge

Answer:

Option (c)

8.

Find the pair of regular expressions that are equivalent.

(a)

(0+1)* and (0*+1*)*

(b)

(0+1)* and (0+1*)*

(c)

(0+10)* and (0*+10)*

(d)

All of the mentioned

Answer:

Option (d)

9.

Which one of the following languages over the alphabet {0,1} is described by the regular expression:

(0+1)*0(0+1)*0(0+1)*

(a)

String with substring 00

(b)

String with at most two 0’s

(c)

String containing at least two 0’s

(d)

None of the mentioned

Answer:

Option (c)

10.

Language of finite automata is

(a)

 Type 0

(b)

 Type 1

(c)

 Type 2

(d)

 Type 3

Answer:

Option (d)

Showing 1 to 10 out of 20 Questions