6 #define IDENT_BUFLEN 256
15 variable curstate fsm->cs;
17 # The data that is to go into the fsm structure.
18 action hello_fails { printf("hello fails\n");}
20 newline = ( any | '\n' @{printf("newline\n");} )*;
21 hello = 'hello\n'* $lerr hello_fails @eof hello_fails;
22 main := newline | hello;
27 void erract_init( struct erract *fsm )
32 void erract_execute( struct erract *fsm, const char *_data, int _len )
34 const char *p = _data;
35 const char *pe = _data+_len;
39 int erract_finish( struct erract *fsm )
43 if ( fsm->cs == erract_error )
45 else if ( fsm->cs >= erract_first_final )
55 void test( char *buf )
57 int len = strlen(buf);
59 erract_execute( &fsm, buf, len );
60 if ( erract_finish( &fsm ) > 0 )
90 #ifdef _____OUTPUT_____