18 // Initialize the machine. Invokes any init statement blocks. Returns 0
19 // if the machine begins in a non-accepting state and 1 if the machine
20 // begins in an accepting state.
23 // Execute the machine on a block of data. Returns -1 if after processing
24 // the data, the machine is in the error state and can never accept, 0 if
25 // the machine is in a non-accepting state and 1 if the machine is in an
27 int execute( LangEl *data, int len );
29 // Indicate that there is no more data. Returns -1 if the machine finishes
30 // in the error state and does not accept, 0 if the machine finishes
31 // in any other non-accepting state and 1 if the machine finishes in an
42 variable eof eof_marker;
49 ${cout << fpc->name << endl;}
50 %/{cout << "accept" << endl;};
61 int Fsm::execute( LangEl *data, int len )
64 LangEl *pe = data + len;
65 LangEl *eof_marker = pe;
68 if ( cs == Fsm_error )
70 if ( cs >= Fsm_first_final )
77 if ( cs == Fsm_error )
79 if ( cs >= Fsm_first_final )
87 static LangEl lel[] = {
96 fsm.execute( lel, 5 );
101 #ifdef _____OUTPUT_____