Write a DFA that recognizes a valid floating point number as described below.
"A floating constant consists of an integer part, a decimal point, a fraction part, an e or E, an optionally signed integer exponent and an optional type suffix, one of f, F, l, or L. The integer and fraction parts both consist of a sequence of digits. Either the integer part or the fraction part (not both) may be missing; either the decimal point or the e and the exponent (not both) may be missing. The type is determined by the suffix; F or f makes it float, l or L makes it long double; otherwise it is double."
Ans.
Deterministic Finite Automaton for particular input there will be a particular state. More than one final states are possible and String is accepted only if it starts from initial state and reaches to final state.
A is the initial state and B,D,G,F,H are the final states.
Get Answers For Free
Most questions answered within 1 hours.