diff options
Diffstat (limited to 'test/rlhc.d/case/any1_c.c-C-G1--goto-backend.in')
-rw-r--r-- | test/rlhc.d/case/any1_c.c-C-G1--goto-backend.in | 111 |
1 files changed, 111 insertions, 0 deletions
diff --git a/test/rlhc.d/case/any1_c.c-C-G1--goto-backend.in b/test/rlhc.d/case/any1_c.c-C-G1--goto-backend.in new file mode 100644 index 00000000..0931412c --- /dev/null +++ b/test/rlhc.d/case/any1_c.c-C-G1--goto-backend.in @@ -0,0 +1,111 @@ +host( "working/any1_c.rl", 1 ) @{/* + * @@LANG: c + * @@GENERATED: true + */ + + #include <string.h> + #include <stdio.h> + + + + + + + + +}@ +array s8 _any1_nfa_targs( 0, 0 ) = { 0, 0 }; + +array s8 _any1_nfa_offsets( 0, 0 ) = { 0, 0, 0, 0 }; + +array s8 _any1_nfa_push_actions( 0, 0 ) = { 0, 0 }; + +array s8 _any1_nfa_pop_trans( 0, 0 ) = { 0, 0 }; + +value int any1_start = 1; +value int any1_first_final = 2; +value int any1_error = 0; + +value int any1_en_main = 1; + +host( "working/any1_c.rl", 20 ) @{ + int cs; + int blen; + char buffer[1024]; + + void init() + { + }@ + { + cs = cast(int)any1_start; + } + host( "working/any1_c.rl", 27 ) @{ + } + + void exec( char *data, int len ) + { + char *p = data; + char *pe = data + len; + }@ + { + if ( p == pe ) + goto _test_eof; + if ( cs == 0 ) + goto _out; + _resume: + switch ( cs ) { + case 1: + { + goto ctr0; + } + case 2: + { + goto ctr1; + } + case 0: + goto _out; + } + + ctr1: cs = 0; goto _again; + ctr0: cs = 2; goto _again; + + _again: + if ( cs == 0 ) + goto _out; + p+= 1; + if ( p != pe ) + goto _resume; + _test_eof: {} + _out: {} + } + host( "working/any1_c.rl", 34 ) @{ + } + + void finish( ) + { + if ( cs >= any1_first_final ) + printf( "ACCEPT\n" ); + else + printf( "FAIL\n" ); + } + + char *inp[] = { + "", + "x", + "xx", + }; + + int inplen = 3; + + int main( ) + { + int i; + for ( i = 0; i < inplen; i++ ) { + init(); + exec( inp[i], strlen(inp[i]) ); + finish(); + } + return 0; + } + +}@
\ No newline at end of file |