diff options
Diffstat (limited to 'test/rlhc.d/case/next1_cs.cs-A-T1--goto-backend.exp')
-rw-r--r-- | test/rlhc.d/case/next1_cs.cs-A-T1--goto-backend.exp | 250 |
1 files changed, 250 insertions, 0 deletions
diff --git a/test/rlhc.d/case/next1_cs.cs-A-T1--goto-backend.exp b/test/rlhc.d/case/next1_cs.cs-A-T1--goto-backend.exp new file mode 100644 index 00000000..c27b8d0e --- /dev/null +++ b/test/rlhc.d/case/next1_cs.cs-A-T1--goto-backend.exp @@ -0,0 +1,250 @@ +using System; +// Disables lots of warnings that appear in the test suite +#pragma warning disable 0168, 0169, 0219, 0162, 0414 +namespace Test { + class Test + { + int target; + + + + + static readonly sbyte []_next1_key_offsets = { 0, 0, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 15, 15, 15, 0, }; + static readonly char []_next1_trans_keys = { '\u000a', '\u0031', '\u0032', '\u0075', '\u006e', '\u0075', '\u0073', '\u0065', '\u0064', '\u006f', '\u006e', '\u0065', '\u0074', '\u0077', '\u006f', '\u0000', }; + static readonly sbyte []_next1_single_lengths = { 0, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, }; + static readonly sbyte []_next1_range_lengths = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, }; + static readonly sbyte []_next1_index_offsets = { 0, 0, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 29, 30, 31, 0, }; + static readonly sbyte []_next1_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, -1, -1, -1, 0, }; + static readonly sbyte []_next1_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, 29, 30, 31, 0, }; + static readonly sbyte []_next1_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, 1, 1, 1, 0, }; + static readonly sbyte []_next1_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, 0, 0, 0, }; + static readonly sbyte []_next1_cond_targs = { 14, 14, 14, 0, 3, 0, 4, 0, 5, 0, 6, 0, 7, 0, 15, 0, 9, 0, 10, 0, 16, 0, 12, 0, 13, 0, 17, 0, 0, 0, 0, 0, 0, }; + static readonly sbyte []_next1_cond_actions = { 0, 1, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, }; + static readonly sbyte []_next1_nfa_targs = { 0, 0, }; + static readonly sbyte []_next1_nfa_offsets = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, }; + static readonly sbyte []_next1_nfa_push_actions = { 0, 0, }; + static readonly sbyte []_next1_nfa_pop_trans = { 0, 0, }; + static readonly int next1_start = 1; + static readonly int next1_first_final = 14; + static readonly int next1_error = 0; + static readonly int next1_en_unused = 2; + static readonly int next1_en_one = 8; + static readonly int next1_en_two = 11; + static readonly int next1_en_main = 1; + int cs; + + void init() + { + + { + cs = (int)next1_start; + } + } + + void exec( char[] data, int len ) + { + int p = 0; + int pe = len; + int eof = len; + string _s; + char [] buffer = new char [1024]; + int blen = 0; + + { + int _klen; + int _keys; + int _ckeys; + int _cpc; + uint _trans = 0; + uint _cond = 0; + if ( p == pe ) + goto _test_eof; + + if ( cs == 0 ) + goto _out; + + _resume : + _keys = _next1_key_offsets[cs] ; + _trans = (uint )_next1_index_offsets[cs]; + _klen = (int)_next1_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 ]) < _next1_trans_keys[_mid ] ) + _upper = _mid - 1; + + else if ( ( data[p ]) > _next1_trans_keys[_mid ] ) + _lower = _mid + 1; + + else + { + _trans += (uint )(_mid - _keys); + goto _match; + } + + } + + _keys += _klen; + _trans += (uint )_klen; + } + + + _klen = (int)_next1_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 ]) < _next1_trans_keys[_mid ] ) + _upper = _mid - 2; + + else if ( ( data[p ]) > _next1_trans_keys[_mid + 1] ) + _lower = _mid + 2; + + else + { + _trans += (uint )((_mid - _keys)>>1); + goto _match; + } + + } + + _trans += (uint )_klen; + } + + + + _match : + _ckeys = _next1_trans_offsets[_trans] ; + _klen = (int)_next1_trans_lengths[_trans]; + _cond = (uint )_next1_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)_next1_cond_keys[_mid ] ) + _upper = _mid - 1; + + else if ( _cpc > (int)_next1_cond_keys[_mid ] ) + _lower = _mid + 1; + + else + { + _cond += (uint )(_mid - _ckeys); + goto _match_cond; + } + + } + + cs = 0; + goto _again; + } + + _match_cond : + cs = (int)_next1_cond_targs[_cond]; + if ( _next1_cond_actions[_cond] == 0 ) + goto _again; + + + switch ( _next1_cond_actions[_cond] ) { + case 3: + {Console.Write( "one\n" );target = 1; + {cs = (target); + }} + + break; + case 4: + {Console.Write( "two\n" );target = 1; + {cs = (target); + }} + + break; + case 1: + {target = 8; + {cs = (target); + }} + + break; + case 2: + {target = 11; + {cs = (target); + }} + + break; + + } + + _again : + if ( cs == 0 ) + goto _out; + + p += 1; + if ( p != pe ) + goto _resume; + + + _test_eof : + {} + + _out : + {} + + } + } + + void finish( ) + { + if ( cs >= next1_first_final ) + Console.WriteLine( "ACCEPT" ); + else + Console.WriteLine( "FAIL" ); + } + + static readonly string[] inp = { + "1one2two1one\n", + }; + + + static readonly int inplen = 1; + + public static void Main (string[] args) + { + Test machine = new Test(); + for ( int i = 0; i < inplen; i++ ) { + machine.init(); + machine.exec( inp[i].ToCharArray(), inp[i].Length ); + machine.finish(); + } + } + } +} |