Assignment - 3 - Compiler Design
Assignment - 3 - Compiler Design
Institute of Technology Kharagpur
Compiler Design
Assignment‐ Week 3
TYPE OF QUESTION:MCQ
Number ofquestions:10 Total mark: 10 X 1 = 10
1. Which of the following is a lexical analysis tool
a) Lex
b) Flex
c) Jflex
d) All of the other options
Ans: d)
Ans: d)
3.
Between NFA and DFA which an has the potential to have more states in it
a) DFA
b) NFA
c) Cannot be said deterministically
d) Both of same number of sets
Ans: a)
a) DFA
b) NFA
c) Regular expression
d) All of the mentioned
Ans: d)
5.
Lex specification file sections are demarcated by
a) %
b) {%
c) %}
d) %%
Ans: d)
7.
Which among the following is false?
ε-closure of a subset S of Q is:
a) Every element of S
b) For any q ϵ ε-closure, every element of δ (q, ε) is in ε-closure.
c) No other element is in ε(S)
d) None of the mentioned
Answer: d)
8.
Output of lex program is available in a file named
a) Lex.c
b) Lex.yy.c
c) Lex.l
d) Lex.yy.l
Ans: b)
9.
All the regular languages can have one or more of the following descriptions:
i) DFA ii) NFA iii) Regular Expressions
Which of the following are correct?
a) i only
b) ii , iii
c) i , ii
d) iii only
Ans: b)
10.
Number of sections in a lex program is
a) 1
b) 2
c) 3
d) 4
Ans: c)
END of Assignment