summaryrefslogtreecommitdiff
path: root/test/rlhc.d/case/gotocallret3_cs.cs-A-G0--goto-backend.exp
diff options
context:
space:
mode:
Diffstat (limited to 'test/rlhc.d/case/gotocallret3_cs.cs-A-G0--goto-backend.exp')
-rw-r--r--test/rlhc.d/case/gotocallret3_cs.cs-A-G0--goto-backend.exp366
1 files changed, 366 insertions, 0 deletions
diff --git a/test/rlhc.d/case/gotocallret3_cs.cs-A-G0--goto-backend.exp b/test/rlhc.d/case/gotocallret3_cs.cs-A-G0--goto-backend.exp
new file mode 100644
index 00000000..e1a9a9a1
--- /dev/null
+++ b/test/rlhc.d/case/gotocallret3_cs.cs-A-G0--goto-backend.exp
@@ -0,0 +1,366 @@
+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 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 _acts;
+ uint _nacts;
+
+ if ( p == pe )
+ goto _test_eof;
+
+ if ( cs == 0 )
+ goto _out;
+
+ _resume:
+ switch ( cs ) {
+ case 7:
+ if ( ( data[p ]) > '\u0039' )
+ {
+ if ( '\u0061'<= ( data[p ]) && ( data[p ]) <= '\u007a' )
+ {
+ goto ctr10;
+ }
+
+ }
+ else if ( ( data[p ]) >= '\u0030' )
+ {
+ goto ctr10;
+ }
+
+ {
+ goto ctr0;
+ }
+ case 0:
+ goto _out;
+ case 1:
+ if ( ( data[p ]) == '\u0020' )
+ {
+ goto ctr1;
+ }
+
+ {
+ goto ctr0;
+ }
+ case 2:
+ if ( ( data[p ]) == '\u000a' )
+ {
+ goto ctr2;
+ }
+
+ {
+ goto ctr0;
+ }
+ case 3:
+ if ( ( data[p ]) == '\u000a' )
+ {
+ goto ctr4;
+ }
+
+ {
+ goto ctr3;
+ }
+ case 4:
+ if ( ( data[p ]) == '\u000a' )
+ {
+ goto ctr6;
+ }
+
+ {
+ goto ctr5;
+ }
+ case 8:
+ {
+ goto ctr11;
+ }
+ case 5:
+ if ( ( data[p ]) > '\u005a' )
+ {
+ if ( '\u0061'<= ( data[p ]) && ( data[p ]) <= '\u007a' )
+ {
+ goto ctr8;
+ }
+
+ }
+ else if ( ( data[p ]) >= '\u0041' )
+ {
+ goto ctr8;
+ }
+
+ {
+ goto ctr7;
+ }
+ case 9:
+ if ( ( data[p ]) > '\u005a' )
+ {
+ if ( '\u0061'<= ( data[p ]) && ( data[p ]) <= '\u007a' )
+ {
+ goto ctr8;
+ }
+
+ }
+ else if ( ( data[p ]) >= '\u0041' )
+ {
+ goto ctr8;
+ }
+
+ {
+ goto ctr7;
+ }
+ case 6:
+ if ( '\u0030'<= ( data[p ]) && ( data[p ]) <= '\u0039' )
+ {
+ goto ctr9;
+ }
+
+ {
+ goto ctr7;
+ }
+ case 10:
+ if ( '\u0030'<= ( data[p ]) && ( data[p ]) <= '\u0039' )
+ {
+ goto ctr9;
+ }
+
+ {
+ goto ctr7;
+ }
+
+ }
+ ctr11: cs = 0;
+ goto _again;
+ ctr0: cs = 0;
+ goto f0;
+ ctr7: cs = 0;
+ goto f7;
+ ctr10: cs = 1;
+ goto f8;
+ ctr1: cs = 2;
+ goto f1;
+ ctr5: cs = 4;
+ goto _again;
+ ctr3: cs = 4;
+ goto f4;
+ ctr2: cs = 7;
+ goto f2;
+ ctr4: cs = 8;
+ goto f5;
+ ctr6: cs = 8;
+ goto f6;
+ ctr8: cs = 9;
+ goto _again;
+ ctr9: cs = 10;
+ goto _again;
+
+ f4: _acts = 1;
+ goto execFuncs;
+ f6: _acts = 3;
+ goto execFuncs;
+ f7: _acts = 7;
+ goto execFuncs;
+ f8: _acts = 9;
+ goto execFuncs;
+ f2: _acts = 11;
+ goto execFuncs;
+ f0: _acts = 13;
+ goto execFuncs;
+ f5: _acts = 15;
+ goto execFuncs;
+ f1: _acts = 18;
+ goto execFuncs;
+
+ execFuncs:
+ _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;
+
+ }
+ _acts += 1;
+ _nacts -= 1;
+ }
+
+
+ goto _again;
+
+ _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;
+
+ }
+ __acts += 1;
+ __nacts -= 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();
+ }
+ }
+ }
+}