Professional Documents
Culture Documents
Assignment 3
Assignment 3
Q1. Which of the following strings is not matched by the regular expression (B(AB|A)*D)*
a) BD
b) BABD
c) BAADBAABDBAD
d) BAADBAABBDBAD
Ans: D: BAADBAABBDBAD
Q3. Between NFA and DFA which an has the potential to have more states in it?
a) NFA
b) DFA
c) Cannot be said deterministically
d) Both have same number of states
Ans: B
DFA can have much greater number of states in it as compared to NFA.
Ans: A
-closure of a state includes all states reachable from it by exactly transitions.
Ans: D
Lex specification file sections are demarcated by %%.
Ans: D
jflex, flex and lex all are lexical analysis tools.
Ans: C
There are 4 components in the formal definition of a grammar, which are, set of nonterminal
symbols used to write the grammar, set of words in the language, set of production rules and a
special symbol signifying the start of the grammar.
Ans: D