] > Table Driven Implementation for DFSAs

2.9 Table Driven Implementation for DFSAs

state = q0  
WHILE( ! end-of-file )  
{  
  char = nextChar()  
  state = table[state,char];  
  IF( undefined( state ) ){ reject(); }  
}  
IF( final(state) ){ accept(); }  
ELSE              { reject(); }




a b



q0q0q1



q1q0q2



q2 q2



      a|-
     |||-
  || - ||||b||||||   |||b||||||-
--  -q0o |||||||||| q1o -||||||||||q2Oo
             a            b