diff options
Diffstat (limited to 'test/rlhc.d/case/curs1_c.c-C-F1--var-backend.exp')
-rw-r--r-- | test/rlhc.d/case/curs1_c.c-C-F1--var-backend.exp | 188 |
1 files changed, 188 insertions, 0 deletions
diff --git a/test/rlhc.d/case/curs1_c.c-C-F1--var-backend.exp b/test/rlhc.d/case/curs1_c.c-C-F1--var-backend.exp new file mode 100644 index 00000000..38e03cd1 --- /dev/null +++ b/test/rlhc.d/case/curs1_c.c-C-F1--var-backend.exp @@ -0,0 +1,188 @@ +#include <string.h> +#include <stdio.h> + +int return_to ; + + + + + +static const char _curs1_trans_keys [] = { 1, 0, 0, 3, 10, 10, 6, 6, 10, 10, 8, 8, 5, 5, 4, 4, 7, 7, 6, 6, 5, 5, 9, 9, 11, 11, 7, 7, 1, 0, 1, 0, 1, 0, 1, 0, 0 , }; +static const char _curs1_char_class [] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 4, 5, 1, 1, 1, 1, 1, 1, 1, 1, 6, 7, 1, 1, 1, 8, 9, 10, 1, 11, 0 , }; +static const char _curs1_index_offsets [] = { 0, 0, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 16, 16, 16, 0 , }; +static const char _curs1_indicies [] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 0 , }; +static const char _curs1_index_defaults [] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0 , }; +static const char _curs1_trans_cond_spaces [] = { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0 , }; +static const char _curs1_cond_targs [] = { 14, 0, 14, 14, 3, 4, 5, 6, 7, 15, 9, 10, 16, 12, 13, 17, 0 , }; +static const char _curs1_cond_actions [] = { 0, 0, 1, 2, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 4, 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; + unsigned int _trans = 0; + unsigned int _have = 0; + unsigned int _cont = 1; + const char *_keys; + const char *_inds; + while ( _cont == 1 ) + { + + if ( cs == 0 ) + _cont = 0; + + _have = 0; + if ( p == pe ) + { + if ( _have == 0 ) + _cont = 0; + + } + + if ( _cont == 1 ) + { + if ( _have == 0 ) + { + _keys = _curs1_trans_keys + (cs<<1); + _inds = _curs1_indicies + _curs1_index_offsets[cs]; + if ( ((*( p )) + )<= 119 && ((*( p )) + )>= 10 ) + { + int _ic = ( int ) _curs1_char_class[( int ) ((*( p )) + )- 10]; + if ( _ic <= ( int ) (*( _keys+1 )) + && _ic >= ( int ) (*( _keys )) + ) + _trans = ( unsigned int ) (*( _inds + ( int ) (_ic - ( int ) (*( _keys )) + ) )) + ; + + else + _trans = ( unsigned int ) _curs1_index_defaults[cs]; + + } + + else + { + _trans = ( unsigned int ) _curs1_index_defaults[cs]; + } + + + } + + if ( _cont == 1 ) + { + _ps = cs; + cs = ( int ) _curs1_cond_targs[_trans]; + switch ( _curs1_cond_actions[_trans] ) { + case 3 : + { + printf( "%s", "one\n" ); + { + cs = (return_to); + + } + + } + + break; + case 4 : + { + printf( "%s", "two\n" ); + { + cs = (return_to); + + } + + } + + break; + case 1 : + { + return_to = (_ps); + { + cs = 8; + + } + + } + + break; + case 2 : + { + return_to = (_ps); + { + cs = 11; + + } + + } + + break; + + } + if ( cs == 0 ) + _cont = 0; + + if ( _cont == 1 ) + p += 1; + + } + } + + } + + } +} + +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; +} + |