6 * Test a high character to make sure signedness
17 // Initialize the machine. Invokes any init statement blocks. Returns 0
18 // if the machine begins in a non-accepting state and 1 if the machine
19 // begins in an accepting state.
22 // Execute the machine on a block of data. Returns -1 if after processing
23 // the data, the machine is in the error state and can never accept, 0 if
24 // the machine is in a non-accepting state and 1 if the machine is in an
26 int execute( const unsigned char *data, int len );
28 // Indicate that there is no more data. Returns -1 if the machine finishes
29 // in the error state and does not accept, 0 if the machine finishes
30 // in any other non-accepting state and 1 if the machine finishes in an
38 alphtype unsigned char;
40 # Indicate we got the high character.
45 main := 0xe8 @gothigh '\n';
56 int Fsm::execute( const unsigned char *_data, int _len )
58 const unsigned char *p = _data;
59 const unsigned char *pe = _data+_len;
61 if ( cs == Fsm_error )
63 if ( cs >= Fsm_first_final )
70 if ( cs == Fsm_error )
72 if ( cs >= Fsm_first_final )
79 void test( unsigned char *buf, int len )
82 fsm.execute( buf, len );
83 if ( fsm.finish() > 0 )
89 unsigned char data1[] = { 0xe8, 10 };
90 unsigned char data2[] = { 0xf8, 10 };
99 #ifdef _____OUTPUT_____