NEW
Font size
WorksheetsQuiz1 TAFL(module-2)2020-21
Total questions: 20
Worksheet time: 10mins
The most suitable data structure used to represent the derivations in compiler:
Queue
Linked List
Tree
Hash Tables
Which of the following statement is false in context of tree terminology?
Root with no children is called a leaf
A node can have three children
Root has no parent
Trees are collection of nodes, with a parent child relationship
In which order are the children of any node ordered?
From the left
From the right
Arbitrarily
None of the mentioned
Which among the following is the root of the parse tree?
Production P
Terminal T
Variable V
Starting Variable S
A grammar with more than one parse tree is called:
Unambiguous
Ambiguous
Regular
None of the mentioned
Grammar is checked by which component of compiler
Scanner
Parser
Semantic Analyzer
None of the mentioned
Given Grammar: S->A, A->aA, A->e, B->bA. Which among the following productions are Useless productions?
S->A
A->aA
A->e
B->bA
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.
{C}
{A,B}
{A,B,S}
None of the mentioned
Given grammar:
S->aS|A
A->a
B->aa
Find the number of variables reachable from the Starting Variable?
0
1
2
None
Inorder to simplify a context free grammar, we can skip the following operation:
a)
b)
c)
Removal of null production
Removal of unit productions
Removal of useless symbols
None
Given a Grammar G:
S->aA
A->a
A->B
B->A
B->bb
Which among the following will be the simplified grammar?
S-aA|aB, A->a, B->bb
S->aA|aB, A->B, B->bb
S->aA|aB, A->a, B->A
None of the mentioned
In context to the process of removing useless symbols, which of the following is correct?
We remove the Nullable variables
We eliminate the unit productions
We eliminate products which yield no terminals
All of the mentioned
Given A->aA| a| b
The number of steps to form aab:
2
3
4
5
The language accepted by Push down Automaton:
Recursive Language
Linearly Bounded language
Context free language
All of the mentioned
Which among the following is the correct option for the given grammar?
G->X111|G1,X->X0|00
{0a1b|a=2,b=3}
{0a1b|a=1,b=5}
{0a1b|a=b}
More than one of the mentioned is correct
Which among the following is not a part of the Context free grammar tuple?
End symbol
Start symbol
Variable
Production
A context free grammar is a ___________
English grammar
Regular grammar
Context sensitive grammar
None of the mentioned
A null production can be referred to as:
String
Symbol
Word
All of the mentioned
The variable which produces an epsilon is called:
empty variable
nullable
terminal
all of the mentioned
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:
true
false
