host( "working/cond7_c.rl", 1 ) @{/* * @@LANG: c * @@GENERATED: true */ #include #include int i ; int c ; }@ value int foo_start = 1; value int foo_first_final = 4; value int foo_error = 0; value int foo_en_main = 1; array s8 _foo_nfa_targs( 0, 0 ) = { 0, 0 }; array s8 _foo_nfa_offsets( 0, 0 ) = { 0, 0, 0, 0, 0, 0 }; array s8 _foo_nfa_push_actions( 0, 0 ) = { 0, 0 }; array s8 _foo_nfa_pop_trans( 0, 0 ) = { 0, 0 }; host( "working/cond7_c.rl", 41 ) @{ int cs; int blen; char buffer[1024]; void init() { }@ { cs = cast(int)foo_start; } host( "working/cond7_c.rl", 48 ) @{ } void exec( char *data, int len ) { char *p = data; char *pe = data + len; }@ { if ( p == pe ) goto _test_eof; switch ( cs ) { case 1: goto st_case_1; case 0: goto st_case_0; case 2: goto st_case_2; case 3: goto st_case_3; case 4: goto st_case_4; } goto st_out; st_case_1: if ( 48 <= ( deref( data, p )) && ( deref( data, p )) <= 57 ) { goto ctr0; } { goto st0; } st_case_0: st0: cs = 0; goto _out; ctr3: host( "working/cond7_c.rl", 16 ) ${i = i - 1; c = ( int ) ( ={( deref( data, p ))}= ) ; printf( "%s", "item: " ); printf( "%d", c ); printf( "%s", "\n" ); }$ goto st2; ctr0: host( "working/cond7_c.rl", 24 ) ${i = ( int ) ( ={( deref( data, p ))}= - 48 ) ; printf( "%s", "count: " ); printf( "%d", i ); printf( "%s", "\n" ); }$ goto st2; st2: p+= 1; if ( p == pe ) goto _test_eof2; st_case_2: if ( 48 <= ( deref( data, p )) && ( deref( data, p )) <= 57 ) { int ck = 0; if ( host( "working/cond7_c.rl", 15 ) ={i > 0}= ) ck += 1; if ( ck > 0 ) { goto ctr3; } else { goto ctr2; } } { goto st0; } ctr2: host( "working/cond7_c.rl", 24 ) ${i = ( int ) ( ={( deref( data, p ))}= - 48 ) ; printf( "%s", "count: " ); printf( "%d", i ); printf( "%s", "\n" ); }$ goto st3; ctr6: host( "working/cond7_c.rl", 16 ) ${i = i - 1; c = ( int ) ( ={( deref( data, p ))}= ) ; printf( "%s", "item: " ); printf( "%d", c ); printf( "%s", "\n" ); }$ goto st3; st3: p+= 1; if ( p == pe ) goto _test_eof3; st_case_3: if ( ( deref( data, p )) == 10 ) { int ck = 0; if ( host( "working/cond7_c.rl", 15 ) ={i > 0}= ) ck += 1; if ( ck <= 0 ) { goto st4; } goto st0; } if ( 48 <= ( deref( data, p )) && ( deref( data, p )) <= 57 ) { int ck = 0; if ( host( "working/cond7_c.rl", 15 ) ={i > 0}= ) ck += 1; if ( 1 <= ck ) { goto ctr6; } goto st0; } { goto st0; } st4: p+= 1; if ( p == pe ) goto _test_eof4; st_case_4: { goto st0; } st_out: _test_eof2: cs = 2; goto _test_eof; _test_eof3: cs = 3; goto _test_eof; _test_eof4: cs = 4; goto _test_eof; _test_eof: {} _out: {} } host( "working/cond7_c.rl", 55 ) @{ } void finish( ) { if ( cs >= foo_first_final ) printf( "ACCEPT\n" ); else printf( "FAIL\n" ); } char *inp[] = { "00\n", "019\n", "190\n", "1719\n", "1040000\n", "104000a\n", "104000\n", }; int inplen = 7; int main( ) { int i; for ( i = 0; i < inplen; i++ ) { init(); exec( inp[i], strlen(inp[i]) ); finish(); } return 0; } }@