Compiler Design | Mock Test
Question 1
An ideal Compiler should
Select one:
A. Be smaller in size
B. Takes less time for compilation
C. Be written in a high level language
D. All of the above
Question 2
For which of the following reason, a compiler is preferred to a interpreter
Select one:
a. It can generate stand-alone programs and often takes less time for execution
b. Debugging can be faster and easier
Question 3
For which of the following reason, a compiler is preferred to a interpreter
Select one:
a. It can generate stand-alone programs and often takes less time for execution
b. Debugging can be faster and easier
Question 4
To design LL parser the grammar should be free from left recursion
Select one:
a. True
b. False
Question 5
In a compiler, grouping of characters into tokens is done by the
Select one:
a. Code optimizer
b. Parser
c. Code generator
d. Scanner
Question 6
In a context free grammar
Select one:
A. ε can not be the right hand side of any production
B. Terminal symbols can not be present in the left hand side of any production
C. The number of grammar symbols in the LHS is not greater than the number of grammar symbols in the RHS
D. All of the above
Question 7
Remove flag
The main difference between DFA and NDFA
Select one:
a.
In DFA from any given state there cannot be any alphabet leading to two different states
b. In NDFA empty transition may be present
c. In NDFA from any given state there cannot be any alphabet leading to two different states
d. In DFA empty transition may be present
Question 8
A syntax tree
Select one:
a. generates tokens
b. Another name of the parse tree
c. Should not have keywords as leaves
d. Is a condensed form of grammar
Question 9
Regular expression letter ( letter | digit)* can be used to recognise set of valid identifiers.
Select one:
a. True
b. False
Question 10
Construction of DFA is easy and implementation of DFA is difficult
Select one:
a. True
b. False