17 m1 = ( "" %{printf("enter m1 aa\n");} |
18 'aa'* >{printf("enter m1 aa\n");} %{printf("leave m1 aa\n");} )
19 'b' @{printf("through m1 b\n");} . 'b'* . 'a'*;
24 m1 %{printf("accept m1\n");} |
25 "" %{printf("enter m2\n");} |
26 m2 >{printf("enter m2\n");} %{printf("accept m2\n");}
32 void forder_init( struct forder *fsm )
37 void forder_execute( struct forder *fsm, const char *_data, int _len )
39 const char *p = _data;
40 const char *pe = _data+_len;
45 int forder_finish( struct forder *fsm )
47 if ( fsm->cs == forder_error )
49 if ( fsm->cs >= forder_first_final )
56 void test( char *buf )
58 int len = strlen( buf );
60 forder_execute( &fsm, buf, len );
61 if ( forder_finish( &fsm ) > 0 )
69 test( "aaaaaabbbaa\n" );
71 test( "bbbbbbaaaaaaa\n" );
72 test( "bbbbbbaaaaaa\n" );
78 #ifdef _____OUTPUT_____