summaryrefslogtreecommitdiff
path: root/test/rlhc.d/case/gotocallret3_cs.cs-A-F0--goto-backend.exp
diff options
context:
space:
mode:
Diffstat (limited to 'test/rlhc.d/case/gotocallret3_cs.cs-A-F0--goto-backend.exp')
-rw-r--r--test/rlhc.d/case/gotocallret3_cs.cs-A-F0--goto-backend.exp255
1 files changed, 255 insertions, 0 deletions
diff --git a/test/rlhc.d/case/gotocallret3_cs.cs-A-F0--goto-backend.exp b/test/rlhc.d/case/gotocallret3_cs.cs-A-F0--goto-backend.exp
new file mode 100644
index 00000000..5b51e036
--- /dev/null
+++ b/test/rlhc.d/case/gotocallret3_cs.cs-A-F0--goto-backend.exp
@@ -0,0 +1,255 @@
+using System;
+// Disables lots of warnings that appear in the test suite
+#pragma warning disable 0168, 0169, 0219, 0162, 0414
+namespace Test {
+ class Test
+ {
+ char comm;
+ int top;
+ int [] stack = new int [32];
+
+
+
+
+ static readonly sbyte []_gotocallret_actions = { 0, 1, 0, 1, 1, 1, 2, 1, 3, 1, 5, 1, 7, 1, 8, 2, 0, 1, 2, 4, 6, 0, };
+ static readonly char []_gotocallret_trans_keys = { '\u0001', '\u0000', '\u0002', '\u0002', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0004', '\u0005', '\u0003', '\u0003', '\u0003', '\u0005', '\u0001', '\u0000', '\u0004', '\u0005', '\u0003', '\u0003', '\u0000', };
+ static readonly sbyte []_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, };
+ static readonly sbyte []_gotocallret_index_offsets = { 0, 0, 1, 2, 3, 4, 6, 7, 10, 10, 12, 0, };
+ static readonly sbyte []_gotocallret_indicies = { 1, 2, 4, 6, 8, 8, 9, 10, 0, 10, 8, 8, 9, 0, };
+ static readonly sbyte []_gotocallret_index_defaults = { 0, 0, 0, 3, 5, 7, 7, 0, 11, 7, 7, 0, };
+ static readonly sbyte []_gotocallret_trans_cond_spaces = { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, };
+ static readonly sbyte []_gotocallret_cond_targs = { 0, 2, 7, 4, 8, 4, 8, 0, 9, 10, 1, 0, 0, };
+ static readonly sbyte []_gotocallret_cond_actions = { 13, 18, 11, 1, 15, 0, 3, 7, 0, 0, 9, 0, 0, };
+ static readonly sbyte []_gotocallret_eof_actions = { 0, 13, 13, 5, 5, 7, 7, 0, 5, 0, 0, 0, };
+ static readonly sbyte []_gotocallret_nfa_targs = { 0, 0, };
+ static readonly sbyte []_gotocallret_nfa_offsets = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, };
+ static readonly sbyte []_gotocallret_nfa_push_actions = { 0, 0, };
+ static readonly sbyte []_gotocallret_nfa_pop_trans = { 0, 0, };
+ static readonly int gotocallret_start = 7;
+ static readonly int gotocallret_first_final = 7;
+ static readonly int gotocallret_error = 0;
+ static readonly int gotocallret_en_garble_line = 3;
+ static readonly int gotocallret_en_alp_comm = 5;
+ static readonly int gotocallret_en_dig_comm = 6;
+ static readonly int gotocallret_en_main = 7;
+ int cs;
+
+ void init()
+ {
+
+ {
+ cs = (int)gotocallret_start;
+ top = 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 :
+ _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 _match_cond;
+
+ _match_cond :
+ cs = (int)_gotocallret_cond_targs[_trans];
+ if ( _gotocallret_cond_actions[_trans] == 0 )
+ goto _again;
+
+
+ _acts = _gotocallret_cond_actions[_trans] ;
+ _nacts = (uint )_gotocallret_actions[_acts ];
+ _acts += 1;
+ while ( _nacts > 0 )
+ {
+ switch ( _gotocallret_actions[_acts ] ) {
+ case 0:
+ {Console.Write( "error: garbling line\n" );}
+
+ break;
+ case 1:
+ {{cs = 7;
+ }}
+
+ break;
+ case 3:
+ {{p = p - 1;
+ }{top -= 1;
+ cs = stack[top];
+ }}
+
+ break;
+ case 4:
+ {if ( comm >= 97 )
+ {
+ {stack[top] = cs;
+ top += 1;
+ cs = 5;
+ }}
+ else {
+ {stack[top] = cs;
+ top += 1;
+ cs = 6;
+ }}
+ }
+
+ break;
+ case 5:
+ {comm = (( data[p ]));
+ }
+
+ break;
+ case 6:
+ {Console.Write( "prints\n" );}
+
+ break;
+ case 7:
+ {Console.Write( "correct command\n" );}
+
+ break;
+ case 8:
+ {{p = p - 1;
+ }{cs = 3;
+ }}
+
+ break;
+
+ }
+ _nacts -= 1;
+ _acts += 1;
+ }
+
+
+
+
+ _again :
+ if ( cs == 0 )
+ goto _out;
+
+ p += 1;
+ if ( p != pe )
+ goto _resume;
+
+
+ _test_eof :
+ {}
+ if ( p == eof )
+ {
+ int __acts;
+ uint __nacts;
+ __acts = _gotocallret_eof_actions[cs] ;
+ __nacts = (uint )_gotocallret_actions[__acts ];
+ __acts += 1;
+ while ( __nacts > 0 )
+ {
+ switch ( _gotocallret_actions[__acts ] ) {
+ case 2:
+ {Console.Write( "error: failed to recover\n" );}
+
+ break;
+ case 3:
+ {{p = p - 1;
+ }{top -= 1;
+ cs = stack[top];
+ }}
+
+ break;
+ case 8:
+ {{p = p - 1;
+ }{cs = 3;
+ }}
+
+ break;
+
+ }
+ __nacts -= 1;
+ __acts += 1;
+ }
+
+ }
+
+
+
+ _out :
+ {}
+
+ }
+ }
+
+ void finish( )
+ {
+ if ( cs >= gotocallret_first_final )
+ Console.WriteLine( "ACCEPT" );
+ else
+ Console.WriteLine( "FAIL" );
+ }
+
+ static readonly 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 readonly int inplen = 17;
+
+ 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();
+ }
+ }
+ }
+}