go to previous page   go to home page   go to next page

When the current character is not accepted by the current state, a transition is made to the reject state. How is this implemented?

Answer:

The last statement is:

else 
  state = reject ;

Last Statement for each State

The last else is reached when all the preceding if and else ifs have a false condition. It causes a state transition to the reject state. When this happens, the current character is not accepted by the current state and the string is rejected by the automaton.


QUESTION 8:

Say that state is 1 and current is 'm'. Does the following evaluate to true or false?

      ( state==1 && current >= 'a' && current <= 'y')