COMPILER DESIGN

LEXICAL ANALYSIS

REGULAR EXPRESSIONS AND FINITE AUTOMATA

Question [CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
From current state, on reading input symbol, it moves to more than one state
A
DFA
B
DFA with epsilon transitions
C
NFA
D
None of the above
Explanation: 

Detailed explanation-1: -In DFA, there is only one path for specific input from the current state to the next state. DFA does not accept the null move, i.e., the DFA cannot change state without any input character. DFA can contain multiple final states.

Detailed explanation-2: -As per the definition of DFA, so as NFA it can have only one initial state.

Detailed explanation-3: -True, Every NFA with more than one final state can be converted into an NFA with a single final state. Add a new state to the NFA and introduce epsilon transitions from every old final state to the new state.

Detailed explanation-4: -If it has multiple final states, you can create an epsilon transition from all of the final states to one common final state, remove the “final state” mark from all of the previously final states so that you have only one final state.

There is 1 question to complete.