0% found this document useful (1 vote)
3K views

Assignment - 3 - Compiler Design

This document contains a 10 question multiple choice quiz on compiler design and lexical analysis tools. The questions cover topics like the differences between DFAs and NFAs, epsilon closures, the sections in a lex specification file, and the output file name of a lex program. All regular languages can be described using DFAs, NFAs, or regular expressions. A lex specification file contains 3 sections demarcated by special symbols.

Uploaded by

dheena thayalan
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (1 vote)
3K views

Assignment - 3 - Compiler Design

This document contains a 10 question multiple choice quiz on compiler design and lexical analysis tools. The questions cover topics like the differences between DFAs and NFAs, epsilon closures, the sections in a lex specification file, and the output file name of a lex program. All regular languages can be described using DFAs, NFAs, or regular expressions. A lex specification file contains 3 sections demarcated by special symbols.

Uploaded by

dheena thayalan
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

NPTEL Online Certification Courses Indian 

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)

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

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)

4. Which of the following has more expressive power

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)

6. -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
Ans: a)

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

You might also like