diff options
Diffstat (limited to 'test/rlhc.d/case/gotocallret1_java.java-J-F0--goto-backend.exp')
-rw-r--r-- | test/rlhc.d/case/gotocallret1_java.java-J-F0--goto-backend.exp | 374 |
1 files changed, 374 insertions, 0 deletions
diff --git a/test/rlhc.d/case/gotocallret1_java.java-J-F0--goto-backend.exp b/test/rlhc.d/case/gotocallret1_java.java-J-F0--goto-backend.exp new file mode 100644 index 00000000..706202fd --- /dev/null +++ b/test/rlhc.d/case/gotocallret1_java.java-J-F0--goto-backend.exp @@ -0,0 +1,374 @@ +class gotocallret1_java +{ + char comm ; + int top ; + int stack [] = new int[32]; + + + + + + private static byte _GotoCallRet_actions [] = { 0, 1, 0, 1, 1, 1, 2, 1, 3, 1, 4, 1, 5, 1, 6, 1, 7, 2, 0, 1, 0 , }; + private static char _GotoCallRet_trans_keys [] = { 1, 0, 2, 2, 0, 0, 0, 0, 0, 0, 4, 5, 3, 3, 3, 5, 1, 0, 4, 5, 3, 3, 0, }; + private static byte _GotoCallRet_char_class [] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 1, 1, 1, 1, 1, 1, 1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 1, 1, 1, 1, 1, 1, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 0 , }; + private static byte _GotoCallRet_index_offsets [] = { 0, 0, 1, 2, 3, 4, 6, 7, 10, 10, 12, 0 , }; + private static byte _GotoCallRet_indicies [] = { 1, 2, 4, 6, 8, 8, 9, 10, 0, 10, 8, 8, 9, 0 , }; + private static byte _GotoCallRet_index_defaults [] = { 0, 0, 0, 3, 5, 7, 7, 0, 11, 7, 7, 0 , }; + private static byte _GotoCallRet_trans_cond_spaces [] = { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0 , }; + private static byte _GotoCallRet_cond_targs [] = { 0, 2, 7, 4, 8, 4, 8, 0, 9, 10, 1, 0, 0 , }; + private static byte _GotoCallRet_cond_actions [] = { 15, 9, 13, 1, 17, 0, 3, 7, 0, 0, 11, 0, 0 , }; + private static byte _GotoCallRet_eof_actions [] = { 0, 15, 15, 5, 5, 7, 7, 0, 5, 0, 0, 0 , }; + private static byte _GotoCallRet_nfa_targs [] = { 0, 0 , }; + private static byte _GotoCallRet_nfa_offsets [] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 , }; + private static byte _GotoCallRet_nfa_push_actions [] = { 0, 0 , }; + private static byte _GotoCallRet_nfa_pop_trans [] = { 0, 0 , }; + private static int GotoCallRet_start = 7; + private static int GotoCallRet_first_final = 7; + private static int GotoCallRet_error = 0; + private static int GotoCallRet_en_garble_line = 3; + private static int GotoCallRet_en_alp_comm = 5; + private static int GotoCallRet_en_dig_comm = 6; + private static int GotoCallRet_en_main = 7; + int cs; + + void init() + { + { + cs = (int)GotoCallRet_start; + top = 0; + + } + } + + void exec( char data[], int len ) + { + char buffer [] = new char[1024]; + int blen = 0; + int p = 0; + int pe = len; + + int eof = len; + String _s; + { + int _trans = 0; + int _acts; + int _nacts; + int _keys; + int _inds; + int _goto_targ = 0; + _goto: while ( true ) { + switch ( _goto_targ ) { + case 0: + if ( p == pe ) + { + _goto_targ = 4; + if (true) + continue _goto; + } + + if ( cs == 0 ) + { + _goto_targ = 5; + if (true) + continue _goto; + } + + case 1: + _keys = (cs<<1) ; + _inds = _GotoCallRet_index_offsets[cs] ; + if ( ( data[p ]) <= 122 && ( data[p ]) >= 10 ) + { + int _ic = (int)_GotoCallRet_char_class[(int)( data[p ]) - 10]; + if ( _ic <= (int)_GotoCallRet_trans_keys[_keys+1 ]&& _ic >= (int)_GotoCallRet_trans_keys[_keys ] ) + _trans = (int)_GotoCallRet_indicies[_inds + (int)( _ic - (int)_GotoCallRet_trans_keys[_keys ]) ]; + + else + _trans = (int)_GotoCallRet_index_defaults[cs]; + + + } + + else + { + _trans = (int)_GotoCallRet_index_defaults[cs]; + + } + + { + _goto_targ = 2; + if (true) + continue _goto; + } + + case 2: + cs = (int)_GotoCallRet_cond_targs[_trans]; + if ( _GotoCallRet_cond_actions[_trans] == 0 ) + { + _goto_targ = 3; + if (true) + continue _goto; + } + + _acts = _GotoCallRet_cond_actions[_trans] ; + _nacts = (int )_GotoCallRet_actions[_acts ]; + _acts += 1; + while ( _nacts > 0 ) + { + switch ( _GotoCallRet_actions[_acts ] ) { + case 0 : + { + System.out.print( "error: garbling line\n" ); + + } + + break; + case 1 : + { + { + cs = 7; + { + _goto_targ = 3; + if (true) + continue _goto; + } + + } + + } + + break; + case 3 : + { + { + p = p - 1; + + } + { + top -= 1; + cs = stack[top]; + { + _goto_targ = 3; + if (true) + continue _goto; + } + + } + + } + + break; + case 4 : + { + if ( comm >= 'a' ) + { + { + stack[top] = cs; + top += 1; + cs = 5; + { + _goto_targ = 3; + if (true) + continue _goto; + } + + } + } + else { + { + stack[top] = cs; + top += 1; + cs = 6; + { + _goto_targ = 3; + if (true) + continue _goto; + } + + } + } + + } + + break; + case 5 : + { + comm = (( data[p ])); + + } + + break; + case 6 : + { + System.out.print( "correct command\n" ); + + } + + break; + case 7 : + { + { + p = p - 1; + + } + { + cs = 3; + { + _goto_targ = 3; + if (true) + continue _goto; + } + + } + + } + + break; + + } + _nacts -= 1; + _acts += 1; + + } + + + case 3: + if ( cs == 0 ) + { + _goto_targ = 5; + if (true) + continue _goto; + } + + p += 1; + if ( p != pe ) + { + _goto_targ = 1; + if (true) + continue _goto; + } + + + case 4: + { + + } + if ( p == eof ) + { + int __acts; + int __nacts; + __acts = _GotoCallRet_eof_actions[cs] ; + __nacts = (int )_GotoCallRet_actions[__acts ]; + __acts += 1; + while ( __nacts > 0 ) + { + switch ( _GotoCallRet_actions[__acts ] ) { + case 2 : + { + System.out.print( "error: failed to recover\n" ); + + } + + break; + case 3 : + { + { + p = p - 1; + + } + { + top -= 1; + cs = stack[top]; + { + _goto_targ = 3; + if (true) + continue _goto; + } + + } + + } + + break; + case 7 : + { + { + p = p - 1; + + } + { + cs = 3; + { + _goto_targ = 3; + if (true) + continue _goto; + } + + } + + } + + break; + + } + __nacts -= 1; + __acts += 1; + + } + + + } + + + case 5: + { + + } + + + } + break; + } + + } + } + + void finish( ) + { + if ( cs >= GotoCallRet_first_final ) + System.out.println( "ACCEPT" ); + else + System.out.println( "FAIL" ); + } + + static final String inp[] = { + "lkajsdf\n", + "2134\n", + "(\n", + "\n", + "*234234()0909 092 -234aslkf09`1 11\n", + "1\n", + "909\n", + "1 a\n", + "11 1\n", + "a 1\n", + "aa a\n", + "1 1\n", + "1 123456\n", + "a a\n", + "a abcdef\n", + "h", + "a aa1", + }; + + static final int inplen = 17; + + public static void main (String[] args) + { + gotocallret1_java machine = new gotocallret1_java(); + for ( int i = 0; i < inplen; i++ ) { + machine.init(); + machine.exec( inp[i].toCharArray(), inp[i].length() ); + machine.finish(); + } + } +} |