diff options
Diffstat (limited to 'test/rlhc.d/case/recdescent5.java-J-T1--goto-backend.exp')
-rw-r--r-- | test/rlhc.d/case/recdescent5.java-J-T1--goto-backend.exp | 438 |
1 files changed, 438 insertions, 0 deletions
diff --git a/test/rlhc.d/case/recdescent5.java-J-T1--goto-backend.exp b/test/rlhc.d/case/recdescent5.java-J-T1--goto-backend.exp new file mode 100644 index 00000000..7a98989a --- /dev/null +++ b/test/rlhc.d/case/recdescent5.java-J-T1--goto-backend.exp @@ -0,0 +1,438 @@ +class recdescent5 +{ + + + private static byte _recdescent_key_offsets [] = { 0, 0, 1, 13, 25, 0 , }; + private static char _recdescent_trans_keys [] = { 125, 32, 95, 123, 125, 9, 10, 48, 57, 65, 90, 97, 122, 32, 95, 123, 125, 9, 10, 48, 57, 65, 90, 97, 122, 32, 95, 123, 125, 9, 10, 48, 57, 65, 90, 97, 122, 0, }; + private static byte _recdescent_single_lengths [] = { 0, 1, 4, 4, 4, 0 , }; + private static byte _recdescent_range_lengths [] = { 0, 0, 4, 4, 4, 0 , }; + private static byte _recdescent_index_offsets [] = { 0, 0, 2, 11, 20, 0 , }; + private static byte _recdescent_trans_cond_spaces [] = { -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, 0 , }; + private static byte _recdescent_trans_offsets [] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 0 , }; + private static byte _recdescent_trans_lengths [] = { 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, 0 , }; + private static byte _recdescent_cond_keys [] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 , }; + private static byte _recdescent_cond_targs [] = { 2, 0, 2, 4, 1, 2, 2, 3, 4, 4, 0, 2, 4, 1, 2, 2, 3, 4, 4, 0, 2, 4, 1, 2, 2, 3, 4, 4, 0, 0 , }; + private static byte _recdescent_cond_actions [] = { 0, 0, 0, 1, 2, 3, 0, 1, 1, 1, 0, 4, 5, 6, 7, 4, 0, 5, 5, 0, 4, 0, 6, 7, 4, 5, 0, 0, 0, 0 , }; + private static byte _recdescent_eof_actions [] = { 0, 0, 0, 4, 4, 0 , }; + private static byte _recdescent_nfa_targs [] = { 0, 0 , }; + private static byte _recdescent_nfa_offsets [] = { 0, 0, 0, 0, 0, 0 , }; + private static byte _recdescent_nfa_push_actions [] = { 0, 0 , }; + private static byte _recdescent_nfa_pop_trans [] = { 0, 0 , }; + private static int recdescent_start = 2; + private static int recdescent_first_final = 2; + private static int recdescent_error = 0; + private static int recdescent_en_main = 2; + static void test( char data[] ) + { + int cs, p = 0, pe = data.length, eof = data.length, item = 0; + int stack[] = new int[1024]; + int stack_size = 1; + int top; + + { + cs = (int)recdescent_start; + top = 0; + + } + { + int _klen; + int _keys; + int _ckeys; + int _cpc; + int _trans = 0; + int _cond = 0; + int _nbreak; + int _goto_targ = 0; + _goto: while ( true ) { + switch ( _goto_targ ) { + case 0: + if ( p == pe ) + { + _goto_targ = 5; + if (true) + continue _goto; + } + + if ( cs == 0 ) + { + _goto_targ = 6; + if (true) + continue _goto; + } + + case 1: + _keys = _recdescent_key_offsets[cs] ; + _trans = (int )_recdescent_index_offsets[cs]; + _klen = (int)_recdescent_single_lengths[cs]; + if ( _klen > 0 ) + { + int _lower; + int _mid; + int _upper; + _lower = _keys; + _upper = _keys + _klen - 1; + while ( true ) + { + if ( _upper < _lower ) + break; + + + _mid = _lower + ((_upper-_lower) >> 1); + if ( ( data[p ]) < _recdescent_trans_keys[_mid ] ) + _upper = _mid - 1; + + else if ( ( data[p ]) > _recdescent_trans_keys[_mid ] ) + _lower = _mid + 1; + + else + { + _trans += (int )(_mid - _keys); + { + _goto_targ = 2; + if (true) + continue _goto; + } + + } + + + } + + _keys += _klen; + _trans += (int )_klen; + + } + + _klen = (int)_recdescent_range_lengths[cs]; + if ( _klen > 0 ) + { + int _lower; + int _mid; + int _upper; + _lower = _keys; + _upper = _keys + (_klen<<1) - 2; + while ( true ) + { + if ( _upper < _lower ) + break; + + + _mid = _lower + (((_upper-_lower) >> 1) & ~1); + if ( ( data[p ]) < _recdescent_trans_keys[_mid ] ) + _upper = _mid - 2; + + else if ( ( data[p ]) > _recdescent_trans_keys[_mid + 1 ] ) + _lower = _mid + 2; + + else + { + _trans += (int )((_mid - _keys)>>1); + { + _goto_targ = 2; + if (true) + continue _goto; + } + + } + + + } + + _trans += (int )_klen; + + } + + + case 2: + _ckeys = _recdescent_trans_offsets[_trans] ; + _klen = (int)_recdescent_trans_lengths[_trans]; + _cond = (int )_recdescent_trans_offsets[_trans]; + _cpc = 0; + { + int _lower; + int _mid; + int _upper; + _lower = _ckeys; + _upper = _ckeys + _klen - 1; + while ( true ) + { + if ( _upper < _lower ) + break; + + + _mid = _lower + ((_upper-_lower) >> 1); + if ( _cpc < (int)_recdescent_cond_keys[_mid ] ) + _upper = _mid - 1; + + else if ( _cpc > (int)_recdescent_cond_keys[_mid ] ) + _lower = _mid + 1; + + else + { + _cond += (int )(_mid - _ckeys); + { + _goto_targ = 3; + if (true) + continue _goto; + } + + } + + + } + + cs = 0; + { + _goto_targ = 4; + if (true) + continue _goto; + } + + } + + case 3: + cs = (int)_recdescent_cond_targs[_cond]; + if ( _recdescent_cond_actions[_cond] == 0 ) + { + _goto_targ = 4; + if (true) + continue _goto; + } + + _nbreak = 0; + switch ( _recdescent_cond_actions[_cond] ) { + case 1 : + { + item = p; + } + + break; + case 4 : + { + String item_data = new String ( data, item, p-item ); + System.out.print( "item: " ); + System.out.print( item_data ); + System.out.print( "\n" ); + + } + + break; + case 2 : + { + System.out.print( "calling main\n" ); + { + { + if ( top == stack_size ) { + System.out.print( "growing stack\n" ); + stack_size = top * 2; + // Don't actually bother to resize here, but we do print messages. + //stack = (int*)realloc( stack, sizeof(int)*stack_size ); + } + + } + stack[top] = cs; + top += 1; + cs = 2; + + } + + } + + break; + case 3 : + { + if ( top == 0 ) { + System.out.print( "STRAY CLOSE\n" ); + { + p+= 1; + _nbreak = 1; + + } + + } + else { + System.out.print( "returning from main\n" ); + { + p = p - 1; + + } + + { + top-= 1; + cs = stack[top]; + { + if ( stack_size > (top * 4) ) { + stack_size = top * 2; + // Don't actually bother to resize here, but we do print messages. + //stack = (int*)realloc( stack, sizeof(int)*stack_size ); + System.out.print( "shrinking stack\n" ); + } + + } + + } + + } + + } + + break; + case 5 : + { + String item_data = new String ( data, item, p-item ); + System.out.print( "item: " ); + System.out.print( item_data ); + System.out.print( "\n" ); + + } + { + item = p; + } + + break; + case 6 : + { + String item_data = new String ( data, item, p-item ); + System.out.print( "item: " ); + System.out.print( item_data ); + System.out.print( "\n" ); + + } + { + System.out.print( "calling main\n" ); + { + { + if ( top == stack_size ) { + System.out.print( "growing stack\n" ); + stack_size = top * 2; + // Don't actually bother to resize here, but we do print messages. + //stack = (int*)realloc( stack, sizeof(int)*stack_size ); + } + + } + stack[top] = cs; + top += 1; + cs = 2; + + } + + } + + break; + case 7 : + { + String item_data = new String ( data, item, p-item ); + System.out.print( "item: " ); + System.out.print( item_data ); + System.out.print( "\n" ); + + } + { + if ( top == 0 ) { + System.out.print( "STRAY CLOSE\n" ); + { + p+= 1; + _nbreak = 1; + + } + + } + else { + System.out.print( "returning from main\n" ); + { + p = p - 1; + + } + + { + top-= 1; + cs = stack[top]; + { + if ( stack_size > (top * 4) ) { + stack_size = top * 2; + // Don't actually bother to resize here, but we do print messages. + //stack = (int*)realloc( stack, sizeof(int)*stack_size ); + System.out.print( "shrinking stack\n" ); + } + + } + + } + + } + + } + + break; + + } + if ( _nbreak == 1 ) + { + _goto_targ = 6; + if (true) + continue _goto; + } + + + case 4: + if ( cs == 0 ) + { + _goto_targ = 6; + if (true) + continue _goto; + } + + p += 1; + if ( p != pe ) + { + _goto_targ = 1; + if (true) + continue _goto; + } + + + case 5: + { + + } + if ( p == eof ) + { + switch ( _recdescent_eof_actions[cs] ) { + case 4 : + { + String item_data = new String ( data, item, p-item ); + System.out.print( "item: " ); + System.out.print( item_data ); + System.out.print( "\n" ); + + } + + break; + + } + + } + + + case 6: + { + + } + + + } + break; + } + + } + if ( cs == recdescent_error ) + System.out.println( "SCANNER ERROR" ); + } + + public static void main( String args[] ) + { + test( "88 foo { 99 {{{{}}}}{ } }".toCharArray() ); + test( "76 } sadf".toCharArray() ); + } +} + |