diff options
Diffstat (limited to 'test/rlhc.d/case/curs1_c.c-C-G0--goto-backend.exp')
-rw-r--r-- | test/rlhc.d/case/curs1_c.c-C-G0--goto-backend.exp | 338 |
1 files changed, 338 insertions, 0 deletions
diff --git a/test/rlhc.d/case/curs1_c.c-C-G0--goto-backend.exp b/test/rlhc.d/case/curs1_c.c-C-G0--goto-backend.exp new file mode 100644 index 00000000..4616be77 --- /dev/null +++ b/test/rlhc.d/case/curs1_c.c-C-G0--goto-backend.exp @@ -0,0 +1,338 @@ +#include <string.h> +#include <stdio.h> + +int return_to ; + + + + + +static const char _curs1_actions [] = { 0, 1, 0, 1, 1, 1, 2, 1, 3, 0 , }; +static const char _curs1_nfa_targs [] = { 0, 0 , }; +static const char _curs1_nfa_offsets [] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 , }; +static const char _curs1_nfa_push_actions [] = { 0, 0 , }; +static const char _curs1_nfa_pop_trans [] = { 0, 0 , }; +static const int curs1_start = 1; +static const int curs1_first_final = 14; +static const int curs1_error = 0; +static const int curs1_en_unused = 2; +static const int curs1_en_one = 8; +static const int curs1_en_two = 11; +static const int curs1_en_main = 1; +int cs; +int blen; +char buffer[1024]; + +void init() +{ + + { + cs = ( int ) curs1_start; + } +} + +void exec( char *data, int len ) +{ + char *p = data; + char *pe = data + len; + + { + int _ps = 0; + const char *_acts; + unsigned int _nacts; + + if ( p == pe ) + goto _test_eof; + + if ( cs == 0 ) + goto _out; + + _resume: + switch ( cs ) { + case 1: + switch ( ((*( p )) + ) ) { + case 10: + { + goto ctr0; + } + case 49: + { + goto ctr2; + } + case 50: + { + goto ctr3; + } + + } + { + goto ctr1; + } + case 0: + goto _out; + case 14: + { + goto ctr1; + } + case 2: + if ( ((*( p )) + )== 117 ) + { + goto ctr4; + } + + { + goto ctr1; + } + case 3: + if ( ((*( p )) + )== 110 ) + { + goto ctr5; + } + + { + goto ctr1; + } + case 4: + if ( ((*( p )) + )== 117 ) + { + goto ctr6; + } + + { + goto ctr1; + } + case 5: + if ( ((*( p )) + )== 115 ) + { + goto ctr7; + } + + { + goto ctr1; + } + case 6: + if ( ((*( p )) + )== 101 ) + { + goto ctr8; + } + + { + goto ctr1; + } + case 7: + if ( ((*( p )) + )== 100 ) + { + goto ctr9; + } + + { + goto ctr1; + } + case 15: + { + goto ctr1; + } + case 8: + if ( ((*( p )) + )== 111 ) + { + goto ctr10; + } + + { + goto ctr1; + } + case 9: + if ( ((*( p )) + )== 110 ) + { + goto ctr11; + } + + { + goto ctr1; + } + case 10: + if ( ((*( p )) + )== 101 ) + { + goto ctr12; + } + + { + goto ctr1; + } + case 16: + { + goto ctr1; + } + case 11: + if ( ((*( p )) + )== 116 ) + { + goto ctr13; + } + + { + goto ctr1; + } + case 12: + if ( ((*( p )) + )== 119 ) + { + goto ctr14; + } + + { + goto ctr1; + } + case 13: + if ( ((*( p )) + )== 111 ) + { + goto ctr15; + } + + { + goto ctr1; + } + case 17: + { + goto ctr1; + } + + } + ctr1: cs = 0; + goto _again; + ctr4: cs = 3; + goto _again; + ctr5: cs = 4; + goto _again; + ctr6: cs = 5; + goto _again; + ctr7: cs = 6; + goto _again; + ctr8: cs = 7; + goto _again; + ctr10: cs = 9; + goto _again; + ctr11: cs = 10; + goto _again; + ctr13: cs = 12; + goto _again; + ctr14: cs = 13; + goto _again; + ctr0: cs = 14; + goto _again; + ctr2: _ps = cs; + cs = 14; + goto f0; + ctr3: _ps = cs; + cs = 14; + goto f1; + ctr9: cs = 15; + goto _again; + ctr12: cs = 16; + goto f2; + ctr15: cs = 17; + goto f3; + + f2: _acts = _curs1_actions + 1 ; + goto execFuncs; + f3: _acts = _curs1_actions + 3 ; + goto execFuncs; + f0: _acts = _curs1_actions + 5 ; + goto execFuncs; + f1: _acts = _curs1_actions + 7 ; + goto execFuncs; + + execFuncs: + _nacts = ( unsigned int ) (*( _acts )) + ; + _acts += 1; + while ( _nacts > 0 ) + { + switch ( (*( _acts )) + ) { + case 0: + { + printf( "%s", "one\n" ); + cs = (return_to); + } + + break; + case 1: + { + printf( "%s", "two\n" ); + cs = (return_to); + } + + break; + case 2: + { + return_to = (_ps); + cs = 8; + } + + break; + case 3: + { + return_to = (_ps); + cs = 11; + } + + break; + + } + _acts += 1; + _nacts -= 1; + } + + + goto _again; + + _again: + if ( cs == 0 ) + goto _out; + + p += 1; + if ( p != pe ) + goto _resume; + + _test_eof: {} + _out: {} + } +} + +void finish( ) +{ + if ( cs >= curs1_first_final ) + printf( "ACCEPT\n" ); + else + printf( "FAIL\n" ); +} + +char *inp[] = { + "1one2two1one\n", +}; + +int inplen = 1; + +int main( ) +{ + int i; + for ( i = 0; i < inplen; i++ ) { + init(); + exec( inp[i], strlen(inp[i]) ); + finish(); + } + return 0; +} + |