NPTEL Compiler Design Week 3 Assignment Answers 2025

NPTEL Compiler Design Week 3 Assignment Answers 2025

1. Which of the following is a lexical analysis tool

a) Lex
b) Flex
c) Iflex
d) All of the other options

Answer :- For Answers Click Here 

2. In a lex specification file “?” stands for

a) 0 or more occurrences of preceding regular expression
b) One or more occurrences of preceding regular expression
c) Exactly one occurrences of preceding regular expression
d) None of the other options

Answer :- 

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

Answer :- 

4. Which of the following has more expressive power

a) DFA
b) NFA
c) Regular expression
d) All of the mentioned

Answer :- 

5. Lex specification file sections are demarcated by

a) %
b) {%
c) %}
d) %%

Answer :- 

6. e-closure of a state includes

a) All states reachable from it by & transitions only
b) All states reachable from it by single & transitions only
c) All states from which this state can be reached using & transitions
d) All states from which this state can be reached using & transitions and all states
reachable from it by & transitions only

Answer :- For Answers Click Here 

7.

Answer :- 

8. Output of lex program is available in a file named

a) Lex.e
b) Lex.yy.c
c) Lex.l’
d) Lex.yy.l

Answer :- 

9.

Answer :- 

10. Number of sections in a lex program is

a) 1
b) 2
c) 3
d) 4

Answer :- For Answers Click Here 
Scroll to Top