5 /* Test repeptition operators. */
19 int execute( const char *data, int len );
26 action begin { cout << "begin" << endl; }
27 action in { cout << "in" << endl; }
28 action end { cout << "end" << endl; }
30 a = 'a' >begin @in %end;
31 b = 'b' >begin @in %end;
32 c = 'c' >begin @in %end;
33 d = 'd' >begin @in %end;
37 ( b {,5} '\n' )* '-\n'
38 ( c {5,} '\n' )* '-\n'
50 int Rep::execute( const char *_data, int _len )
52 const char *p = _data;
53 const char *pe = _data+_len;
57 if ( cs == Rep_error )
59 if ( cs >= Rep_first_final )
66 if ( cs == Rep_error )
68 if ( cs >= Rep_first_final )
73 void test( const char *buf )
76 int len = strlen( buf );
78 rep.execute( buf, len );
79 if ( rep.finish() > 0 )
120 #ifdef _____OUTPUT_____