wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

Quiz1 TAFL(module-2)2020-21

Total questions: 20

Worksheet time: 10mins

Name
Class
Date
1.

The most suitable data structure used to represent the derivations in compiler:

a)

Queue

b)

Linked List

c)

Tree

d)

Hash Tables

2.

Which of the following statement is false in context of tree terminology?

a)

Root with no children is called a leaf

b)

A node can have three children

c)

Root has no parent

d)

Trees are collection of nodes, with a parent child relationship

3.

In which order are the children of any node ordered?

a)

From the left

b)

From the right

c)

Arbitrarily

d)

None of the mentioned

4.

Which among the following is the root of the parse tree?

a)

Production P

b)

Terminal T

c)

Variable V

d)

Starting Variable S

5.

A grammar with more than one parse tree is called:

a)

Unambiguous

b)

Ambiguous

c)

Regular

d)

None of the mentioned

6.

Grammar is checked by which component of compiler

a)

Scanner

b)

Parser

c)

Semantic Analyzer

d)

None of the mentioned

7.

Given Grammar: S->A, A->aA, A->e, B->bA. Which among the following productions are Useless productions?

a)

S->A

b)

A->aA

c)

A->e

d)

B->bA

8.

Given grammar G:

S->aS|A|C

A->a

B->aa

C->aCb

Find the set of variables that can produce strings only with the set of terminals.

a)

{C}

b)

{A,B}

c)

{A,B,S}

d)

None of the mentioned

9.

Given grammar:

S->aS|A

A->a

B->aa

Find the number of variables reachable from the Starting Variable?

a)

0

b)

1

c)

2

d)

None

10.

Inorder to simplify a context free grammar, we can skip the following operation:

a)

b)

c)

a)

Removal of null production

b)

Removal of unit productions

c)

Removal of useless symbols

d)

None

11.

Given a Grammar G:

S->aA

A->a

A->B

B->A

B->bb

Which among the following will be the simplified grammar?

a)

S-aA|aB, A->a, B->bb

b)

S->aA|aB, A->B, B->bb

c)

S->aA|aB, A->a, B->A

d)

None of the mentioned

12.

In context to the process of removing useless symbols, which of the following is correct?

a)

We remove the Nullable variables

b)

We eliminate the unit productions

c)

We eliminate products which yield no terminals

d)

All of the mentioned

13.

Given A->aA| a| b

The number of steps to form aab:

a)

2

b)

3

c)

4

d)

5

14.

The language accepted by Push down Automaton:

a)

Recursive Language

b)

Linearly Bounded language

c)

Context free language

d)

All of the mentioned

15.

Which among the following is the correct option for the given grammar?

G->X111|G1,X->X0|00

a)

{0a1b|a=2,b=3}

b)

{0a1b|a=1,b=5}

c)

{0a1b|a=b}

d)

More than one of the mentioned is correct

16.

Which among the following is not a part of the Context free grammar tuple?

a)

End symbol

b)

Start symbol

c)

Variable

d)

Production

17.

A context free grammar is a ___________

a)

English grammar

b)

Regular grammar

c)

Context sensitive grammar

d)

None of the mentioned

18.

A null production can be referred to as:

a)

String

b)

Symbol

c)

Word

d)

All of the mentioned

19.

The variable which produces an epsilon is called:

a)

empty variable

b)

nullable

c)

terminal

d)

all of the mentioned

20.

For A-> e ,A can be erased. So whenever it appears on the left side of a production, replace with another production without the A.

State true or false:

a)

true

b)

false