Any number.
The example automaton has just one final state. But, in general, automata can have any number of final states. For flexibility, our implementation has a list of final states. A final state (for us) can be any state, 0 or higher. The pseudocode for handling final states is:
finalStates: list of final states addFinal( state ) { add state to the list of final states; } boolean isFinal( state ) { if (state is in list of final states) return true; else return false; }
The table-driven automaton will be contained in an object,
with methods addTrans()
, addFinal()
,
isFinal()
, and recognize()
.
What should the constructor of the object do?