diff options
Diffstat (limited to 'test/rlhc.d/case/scan1_cs.cs-A-T0--goto-backend.exp')
-rw-r--r-- | test/rlhc.d/case/scan1_cs.cs-A-T0--goto-backend.exp | 408 |
1 files changed, 408 insertions, 0 deletions
diff --git a/test/rlhc.d/case/scan1_cs.cs-A-T0--goto-backend.exp b/test/rlhc.d/case/scan1_cs.cs-A-T0--goto-backend.exp new file mode 100644 index 00000000..ec4e973a --- /dev/null +++ b/test/rlhc.d/case/scan1_cs.cs-A-T0--goto-backend.exp @@ -0,0 +1,408 @@ +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 ts; + int te; + int act; + int token; + + + + + static readonly sbyte []_scanner_actions = { 0, 1, 2, 1, 3, 1, 6, 1, 7, 1, 8, 1, 9, 1, 10, 1, 11, 1, 12, 1, 13, 2, 0, 1, 2, 3, 4, 2, 3, 5, 0, }; + static readonly sbyte []_scanner_key_offsets = { 0, 0, 4, 5, 6, 7, 8, 14, 21, 22, 23, 0, }; + static readonly char []_scanner_trans_keys = { '\u002e', '\u0064', '\u0030', '\u0039', '\u0031', '\u0078', '\u0078', '\u0078', '\u002e', '\u0031', '\u0032', '\u0064', '\u0030', '\u0039', '\u000a', '\u0061', '\u0062', '\u0063', '\u0064', '\u0030', '\u0039', '\u0062', '\u0064', '\u002e', '\u0064', '\u0030', '\u0039', '\u0000', }; + static readonly sbyte []_scanner_single_lengths = { 0, 2, 1, 1, 1, 1, 4, 5, 1, 1, 2, 0, }; + static readonly sbyte []_scanner_range_lengths = { 0, 1, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, }; + static readonly sbyte []_scanner_index_offsets = { 0, 0, 4, 6, 8, 10, 12, 18, 25, 27, 29, 0, }; + static readonly sbyte []_scanner_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, -1, -1, -1, -1, -1, -1, -1, -1, 0, }; + static readonly sbyte []_scanner_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, 32, 33, 34, 35, 36, 37, 38, 39, 0, }; + static readonly sbyte []_scanner_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, 1, 1, 1, 1, 1, 1, 1, 1, 0, }; + static readonly sbyte []_scanner_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, 0, 0, 0, 0, 0, 0, 0, 0, }; + static readonly sbyte []_scanner_cond_targs = { 7, 1, 1, 7, 9, 0, 4, 7, 5, 7, 7, 7, 7, 10, 10, 1, 1, 0, 7, 7, 8, 2, 6, 1, 0, 8, 7, 3, 7, 7, 1, 1, 7, 7, 7, 7, 7, 7, 7, 7, 0, }; + static readonly sbyte []_scanner_cond_actions = { 9, 0, 0, 19, 3, 0, 0, 17, 0, 17, 7, 17, 9, 24, 27, 0, 0, 0, 11, 5, 0, 0, 0, 0, 0, 0, 13, 0, 15, 9, 0, 0, 19, 19, 17, 17, 17, 13, 15, 19, 0, }; + static readonly sbyte []_scanner_to_state_actions = { 0, 0, 0, 0, 0, 0, 0, 21, 0, 0, 0, 0, }; + static readonly sbyte []_scanner_from_state_actions = { 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, }; + static readonly sbyte []_scanner_eof_trans_indexed = { 0, 8, 0, 10, 10, 10, 0, 0, 14, 15, 8, 0, }; + static readonly sbyte []_scanner_eof_trans_direct = { 0, 34, 0, 35, 36, 37, 0, 0, 38, 39, 40, 0, }; + static readonly sbyte []_scanner_nfa_targs = { 0, 0, }; + static readonly sbyte []_scanner_nfa_offsets = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, }; + static readonly sbyte []_scanner_nfa_push_actions = { 0, 0, }; + static readonly sbyte []_scanner_nfa_pop_trans = { 0, 0, }; + static readonly int scanner_start = 7; + static readonly int scanner_first_final = 7; + static readonly int scanner_error = 0; + static readonly int scanner_en_main = 7; + int cs; + + void init() + { + + { + cs = (int)scanner_start; + ts = 0; + te = 0; + act = 0; + } + } + + 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; + uint _trans = 0; + uint _cond = 0; + int _acts; + uint _nacts; + int _keys; + int _ckeys; + int _cpc; + if ( p == pe ) + goto _test_eof; + + if ( cs == 0 ) + goto _out; + + _resume : + _acts = _scanner_from_state_actions[cs] ; + _nacts = (uint )_scanner_actions[_acts ]; + _acts += 1; + while ( _nacts > 0 ) + { + switch ( _scanner_actions[_acts ] ) { + case 2: + {{ts = p; + }} + + break; + + } + _nacts -= 1; + _acts += 1; + } + + + _keys = _scanner_key_offsets[cs] ; + _trans = (uint )_scanner_index_offsets[cs]; + _klen = (int)_scanner_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 ]) < _scanner_trans_keys[_mid ] ) + _upper = _mid - 1; + + else if ( ( data[p ]) > _scanner_trans_keys[_mid ] ) + _lower = _mid + 1; + + else + { + _trans += (uint )(_mid - _keys); + goto _match; + } + + } + + _keys += _klen; + _trans += (uint )_klen; + } + + + _klen = (int)_scanner_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 ]) < _scanner_trans_keys[_mid ] ) + _upper = _mid - 2; + + else if ( ( data[p ]) > _scanner_trans_keys[_mid + 1] ) + _lower = _mid + 2; + + else + { + _trans += (uint )((_mid - _keys)>>1); + goto _match; + } + + } + + _trans += (uint )_klen; + } + + + + _match : + _ckeys = _scanner_trans_offsets[_trans] ; + _klen = (int)_scanner_trans_lengths[_trans]; + _cond = (uint )_scanner_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)_scanner_cond_keys[_mid ] ) + _upper = _mid - 1; + + else if ( _cpc > (int)_scanner_cond_keys[_mid ] ) + _lower = _mid + 1; + + else + { + _cond += (uint )(_mid - _ckeys); + goto _match_cond; + } + + } + + cs = 0; + goto _again; + } + + _match_cond : + cs = (int)_scanner_cond_targs[_cond]; + if ( _scanner_cond_actions[_cond] == 0 ) + goto _again; + + + _acts = _scanner_cond_actions[_cond] ; + _nacts = (uint )_scanner_actions[_acts ]; + _acts += 1; + while ( _nacts > 0 ) + { + switch ( _scanner_actions[_acts ] ) { + case 3: + {{te = p+1; + }} + + break; + case 4: + {{act = 4; + }} + + break; + case 5: + {{act = 5; + }} + + break; + case 6: + {{te = p+1; + {Console.Write( "on last " );if ( p + 1 == te ) + { + Console.Write( "yes" ); + } + Console.Write( "\n" );} + }} + + break; + case 7: + {{te = p+1; + {Console.Write( "on lag " );if ( p + 1 == te ) + { + Console.Write( "yes" ); + } + Console.Write( "\n" );} + }} + + break; + case 8: + {{te = p+1; + }} + + break; + case 9: + {{te = p+1; + }} + + break; + case 10: + {{te = p; + p = p - 1; + {Console.Write( "on next " );if ( p + 1 == te ) + { + Console.Write( "yes" ); + } + Console.Write( "\n" );} + }} + + break; + case 11: + {{te = p; + p = p - 1; + {Console.Write( "on lag " );if ( p + 1 == te ) + { + Console.Write( "yes" ); + } + Console.Write( "\n" );} + }} + + break; + case 12: + {{p = ((te))-1; + {Console.Write( "on lag " );if ( p + 1 == te ) + { + Console.Write( "yes" ); + } + Console.Write( "\n" );} + }} + + break; + case 13: + {{switch ( act ) { + case 0: + {{cs = 0; + goto _again;}} + + break; + case 4: + p = ((te))-1; + {Console.Write( "lm switch1 " );if ( p + 1 == te ) + { + Console.Write( "yes" ); + } + Console.Write( "\n" );} + + break; + case 5: + p = ((te))-1; + {Console.Write( "lm switch2 " );if ( p + 1 == te ) + { + Console.Write( "yes" ); + } + Console.Write( "\n" );} + + break; + + } + } + } + + break; + + } + _nacts -= 1; + _acts += 1; + } + + + + + _again : + _acts = _scanner_to_state_actions[cs] ; + _nacts = (uint )_scanner_actions[_acts ]; + _acts += 1; + while ( _nacts > 0 ) + { + switch ( _scanner_actions[_acts ] ) { + case 0: + {{ts = 0; + }} + + break; + case 1: + {{act = 0; + }} + + break; + + } + _nacts -= 1; + _acts += 1; + } + + + if ( cs == 0 ) + goto _out; + + p += 1; + if ( p != pe ) + goto _resume; + + + _test_eof : + {} + if ( p == eof ) + { + if ( _scanner_eof_trans_direct[cs] > 0 ) + { + _trans = (uint )_scanner_eof_trans_direct[cs] - 1; + _cond = (uint )_scanner_trans_offsets[_trans]; + goto _match_cond; + } + + } + + + + _out : + {} + + } + } + + void finish( ) + { + if ( cs >= scanner_first_final ) + Console.WriteLine( "ACCEPT" ); + else + Console.WriteLine( "FAIL" ); + } + + static readonly string[] inp = { + "abbc1d1d2\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(); + } + } + } +} |