diff options
Diffstat (limited to 'test/rlhc.d/case/gotocallret3_go.go-Z-G2--goto-backend.in')
-rw-r--r-- | test/rlhc.d/case/gotocallret3_go.go-Z-G2--goto-backend.in | 347 |
1 files changed, 347 insertions, 0 deletions
diff --git a/test/rlhc.d/case/gotocallret3_go.go-Z-G2--goto-backend.in b/test/rlhc.d/case/gotocallret3_go.go-Z-G2--goto-backend.in new file mode 100644 index 00000000..3d0619bb --- /dev/null +++ b/test/rlhc.d/case/gotocallret3_go.go-Z-G2--goto-backend.in @@ -0,0 +1,347 @@ +host( "working/gotocallret3_go.rl", 1 ) @{/* + * @@LANG: go + * @@GENERATED: true + */ + + package main + import "fmt" + + var comm byte ; + var top int ; + var stack [32] int ; + + + + + var cs int; + var blen int; + var buffer [1024] byte; + +}@ +value int gotocallret_start = 7; +value int gotocallret_first_final = 7; +value int gotocallret_error = 0; + +value int gotocallret_en_garble_line = 3; +value int gotocallret_en_alp_comm = 5; +value int gotocallret_en_dig_comm = 6; +value int gotocallret_en_main = 7; + +array s8 _gotocallret_nfa_targs( 0, 0 ) = { 0, 0 }; + +array s8 _gotocallret_nfa_offsets( 0, 0 ) = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; + +array s8 _gotocallret_nfa_push_actions( 0, 0 ) = { 0, 0 }; + +array s8 _gotocallret_nfa_pop_trans( 0, 0 ) = { 0, 0 }; + +host( "working/gotocallret3_go.rl", 72 ) @{ + + func prepare() { + }@ + { + cs = cast(int)gotocallret_start; + top = 0; + } + host( "working/gotocallret3_go.rl", 75 ) @{ + } + + func exec(data string) { + var p int = 0 + var pe int = len(data) + var eof int = pe + }@ + { + if ( p == pe ) + goto _test_eof; + goto _resume; + + _again: + switch ( cs ) { + case 7: goto st7; + case 0: goto st0; + case 1: goto st1; + case 2: goto st2; + case 3: goto st3; + case 4: goto st4; + case 8: goto st8; + case 5: goto st5; + case 9: goto st9; + case 6: goto st6; + case 10: goto st10; + } + + _resume: + switch ( cs ) + { + case 7: + goto st_case_7; + case 0: + goto st_case_0; + case 1: + goto st_case_1; + case 2: + goto st_case_2; + case 3: + goto st_case_3; + case 4: + goto st_case_4; + case 8: + goto st_case_8; + case 5: + goto st_case_5; + case 9: + goto st_case_9; + case 6: + goto st_case_6; + case 10: + goto st_case_10; + } + goto st_out; + ctr2: + host( "working/gotocallret3_go.rl", 57 ) ${fmt.Print( "correct command\n" );}$ + + goto st7; + st7: + p+= 1; + if ( p == pe ) + goto _test_eof7; + st_case_7: + if ( ( deref( data, p )) > 57 ) { + if ( 97 <= ( deref( data, p )) && ( deref( data, p )) <= 122 ) { + goto ctr10; + } + } else if ( ( deref( data, p )) >= 48 ) { + goto ctr10; + } + { + goto ctr0; + } + ctr0: + cs = 0; + host( "working/gotocallret3_go.rl", 61 ) ${${p = p - 1; }$ + cs = 3;}$ + + goto _again; + ctr7: + cs = 0; + host( "working/gotocallret3_go.rl", 32 ) ${${p = p - 1; }$ + ${top -= 1;cs = stack[top];}$ + }$ + + goto _again; + st_case_0: + st0: + cs = 0; + goto _out; + ctr10: + host( "working/gotocallret3_go.rl", 55 ) ${comm = ={( deref( data, p ))}=; + }$ + + goto st1; + st1: + p+= 1; + if ( p == pe ) + goto _test_eof1; + st_case_1: + if ( ( deref( data, p )) == 32 ) { + goto ctr1; + } + { + goto ctr0; + } + ctr1: + cs = 2; + host( "working/gotocallret3_go.rl", 42 ) ${if ( comm >= 97 ) { + ${stack[top] = 2; top+= 1; cs = 5; }$} else { + ${stack[top] = 2; top+= 1; cs = 6; }$} + }$ + host( "working/gotocallret3_go.rl", 56 ) ${fmt.Print( "prints\n" );}$ + + goto _again; + st2: + p+= 1; + if ( p == pe ) + goto _test_eof2; + st_case_2: + if ( ( deref( data, p )) == 10 ) { + goto ctr2; + } + { + goto ctr0; + } + st3: + p+= 1; + if ( p == pe ) + goto _test_eof3; + st_case_3: + if ( ( deref( data, p )) == 10 ) { + goto ctr4; + } + { + goto ctr3; + } + ctr3: + host( "working/gotocallret3_go.rl", 20 ) ${fmt.Print( "error: garbling line\n" );}$ + + goto st4; + st4: + p+= 1; + if ( p == pe ) + goto _test_eof4; + st_case_4: + if ( ( deref( data, p )) == 10 ) { + goto ctr6; + } + { + goto st4; + } + ctr4: + cs = 8; + host( "working/gotocallret3_go.rl", 20 ) ${fmt.Print( "error: garbling line\n" );}$ + host( "working/gotocallret3_go.rl", 21 ) ${cs = 7;}$ + + goto _again; + ctr6: + cs = 8; + host( "working/gotocallret3_go.rl", 21 ) ${cs = 7;}$ + + goto _again; + st8: + p+= 1; + if ( p == pe ) + goto _test_eof8; + st_case_8: + { + goto st0; + } + st5: + p+= 1; + if ( p == pe ) + goto _test_eof5; + st_case_5: + if ( ( deref( data, p )) > 90 ) { + if ( 97 <= ( deref( data, p )) && ( deref( data, p )) <= 122 ) { + goto st9; + } + } else if ( ( deref( data, p )) >= 65 ) { + goto st9; + } + { + goto ctr7; + } + st9: + p+= 1; + if ( p == pe ) + goto _test_eof9; + st_case_9: + if ( ( deref( data, p )) > 90 ) { + if ( 97 <= ( deref( data, p )) && ( deref( data, p )) <= 122 ) { + goto st9; + } + } else if ( ( deref( data, p )) >= 65 ) { + goto st9; + } + { + goto ctr7; + } + st6: + p+= 1; + if ( p == pe ) + goto _test_eof6; + st_case_6: + if ( 48 <= ( deref( data, p )) && ( deref( data, p )) <= 57 ) { + goto st10; + } + { + goto ctr7; + } + st10: + p+= 1; + if ( p == pe ) + goto _test_eof10; + st_case_10: + if ( 48 <= ( deref( data, p )) && ( deref( data, p )) <= 57 ) { + goto st10; + } + { + goto ctr7; + } + st_out: + _test_eof7: cs = 7; goto _test_eof; + _test_eof1: cs = 1; goto _test_eof; + _test_eof2: cs = 2; goto _test_eof; + _test_eof3: cs = 3; goto _test_eof; + _test_eof4: cs = 4; goto _test_eof; + _test_eof8: cs = 8; goto _test_eof; + _test_eof5: cs = 5; goto _test_eof; + _test_eof9: cs = 9; goto _test_eof; + _test_eof6: cs = 6; goto _test_eof; + _test_eof10: cs = 10; goto _test_eof; + + _test_eof: {} + if ( p == eof ) + { + switch ( cs ) { + case 3: + fallthrough; + case 4: + fallthrough; + case 8: + host( "working/gotocallret3_go.rl", 23 ) ${fmt.Print( "error: failed to recover\n" );}$ + break; + case 5: + fallthrough; + case 6: + host( "working/gotocallret3_go.rl", 32 ) ${${p = p - 1; }$ + ${top -= 1;cs = stack[top];}$ + }$ + break; + case 1: + fallthrough; + case 2: + host( "working/gotocallret3_go.rl", 61 ) ${${p = p - 1; }$ + cs = 3;}$ + break; + } + } + + _out: {} + } + host( "working/gotocallret3_go.rl", 82 ) @{ + } + func finish() { + if cs >= gotocallret_first_final { + fmt.Println("ACCEPT") + } else { + fmt.Println("FAIL") + } + } + var inp []string = []string { + "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", + }; + + func main() { + for _, data := range inp { + prepare() + exec(data) + finish() + } + } +}@
\ No newline at end of file |