12 int cs, top, stack[32];
26 # Test call and return functionality.
27 even := 'even' any @{fhold; fret;};
28 odd := 'odd' any @{fhold; fret;};
29 num = [0-9]+ ${ num = num * 10 + (fc - '0'); };
30 even_odd = num ' ' @check_num "\n";
32 # Test calls in out actions.
34 out_acts = 'OA ok\n' |
38 main := even_odd | out_acts;
43 void test_init( struct test *fsm )
49 void test_execute( struct test *fsm, const char *data, int len )
52 const char *pe = data+len;
57 int test_finish( struct test *fsm )
59 if ( fsm->cs == test_error )
61 if ( fsm->cs >= test_first_final )
68 void test( char *buf )
72 test_execute( &test, buf, strlen(buf) );
73 if ( test_finish( &test ) > 0 )
86 test( "OA error1\n" );
87 test( "OA error2\n" );
93 #ifdef _____OUTPUT_____