diff options
Diffstat (limited to 'test/rlhc.d/case/scan3_cs.cs-A-F0--goto-backend.exp')
-rw-r--r-- | test/rlhc.d/case/scan3_cs.cs-A-F0--goto-backend.exp | 245 |
1 files changed, 245 insertions, 0 deletions
diff --git a/test/rlhc.d/case/scan3_cs.cs-A-F0--goto-backend.exp b/test/rlhc.d/case/scan3_cs.cs-A-F0--goto-backend.exp new file mode 100644 index 00000000..eda543c3 --- /dev/null +++ b/test/rlhc.d/case/scan3_cs.cs-A-F0--goto-backend.exp @@ -0,0 +1,245 @@ +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, 0, 1, 1, 1, 6, 2, 2, 3, 2, 2, 4, 2, 2, 5, 0, }; + static readonly char []_scanner_trans_keys = { '\u0001', '\u0000', '\u0000', '\u0001', '\u0001', '\u0000', '\u0000', }; + static readonly sbyte []_scanner_char_class = { 0, 1, 0, }; + static readonly sbyte []_scanner_index_offsets = { 0, 0, 2, 0, }; + static readonly sbyte []_scanner_indicies = { 0, 2, 0, }; + static readonly sbyte []_scanner_index_defaults = { 0, 1, 4, 0, }; + static readonly sbyte []_scanner_trans_cond_spaces = { -1, -1, -1, -1, -1, 0, }; + static readonly sbyte []_scanner_cond_targs = { 2, 0, 2, 1, 2, 0, }; + static readonly sbyte []_scanner_cond_actions = { 7, 0, 10, 5, 13, 0, }; + static readonly sbyte []_scanner_to_state_actions = { 0, 1, 0, 0, }; + static readonly sbyte []_scanner_from_state_actions = { 0, 3, 0, 0, }; + static readonly sbyte []_scanner_eof_trans = { 0, 0, 4, 0, }; + static readonly sbyte []_scanner_nfa_targs = { 0, 0, }; + static readonly sbyte []_scanner_nfa_offsets = { 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 = 1; + static readonly int scanner_first_final = 1; + static readonly int scanner_error = 0; + static readonly int scanner_en_main = 1; + 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 _trans = 0; + int _acts; + uint _nacts; + int _keys; + int _inds; + 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 1: + {{ts = p; + }} + + break; + + } + _nacts -= 1; + _acts += 1; + } + + + _keys = (cs<<1) ; + _inds = _scanner_index_offsets[cs] ; + if ( ( data[p ]) <= 98&& ( data[p ]) >= 97 ) + { + int _ic = (int)_scanner_char_class[(int)( data[p ]) - 97]; + if ( _ic <= (int)_scanner_trans_keys[_keys+1]&& _ic >= (int)_scanner_trans_keys[_keys ] ) + _trans = (int)_scanner_indicies[_inds + (int)( _ic - (int)_scanner_trans_keys[_keys ]) ]; + + else + _trans = (int)_scanner_index_defaults[cs]; + + } + + else + { + _trans = (int)_scanner_index_defaults[cs]; + } + + + goto _match_cond; + + _match_cond : + cs = (int)_scanner_cond_targs[_trans]; + if ( _scanner_cond_actions[_trans] == 0 ) + goto _again; + + + _acts = _scanner_cond_actions[_trans] ; + _nacts = (uint )_scanner_actions[_acts ]; + _acts += 1; + while ( _nacts > 0 ) + { + switch ( _scanner_actions[_acts ] ) { + case 2: + {{te = p+1; + }} + + break; + case 3: + {{act = 1; + }} + + break; + case 4: + {{act = 2; + }} + + break; + case 5: + {{act = 3; + }} + + break; + case 6: + {{switch ( act ) { + case 1: + p = ((te))-1; + {Console.Write( "pat1\n" );} + + break; + case 2: + p = ((te))-1; + {Console.Write( "pat2\n" );} + + break; + case 3: + p = ((te))-1; + {Console.Write( "pat3\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; + + } + _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[cs] > 0 ) + { + _trans = (int)_scanner_eof_trans[cs] - 1; + goto _match_cond; + } + + } + + + + _out : + {} + + } + } + + void finish( ) + { + if ( cs >= scanner_first_final ) + Console.WriteLine( "ACCEPT" ); + else + Console.WriteLine( "FAIL" ); + } + + static readonly string[] inp = { + "ab89", + }; + + + 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(); + } + } + } +} |