diff options
Diffstat (limited to 'test/rlhc.d/case/cond1_go.go-Z-G0--goto-backend.exp')
-rw-r--r-- | test/rlhc.d/case/cond1_go.go-Z-G0--goto-backend.exp | 492 |
1 files changed, 492 insertions, 0 deletions
diff --git a/test/rlhc.d/case/cond1_go.go-Z-G0--goto-backend.exp b/test/rlhc.d/case/cond1_go.go-Z-G0--goto-backend.exp new file mode 100644 index 00000000..d7db69c6 --- /dev/null +++ b/test/rlhc.d/case/cond1_go.go-Z-G0--goto-backend.exp @@ -0,0 +1,492 @@ +package main +import "fmt" + +var i int ; +var j int ; +var k int ; + + + + +var cs int; +var blen int; +var buffer [1024] byte; + +var _foo_actions [] int8 = [] int8 { 0, 1, 0, 1, 1, 1, 2, 1, 3, 1, 4, 1, 5, 1, 6, 2, 0, 1, 2, 0, 2, 2, 1, 2, 3, 0, 1, 2, 0 } +var _foo_nfa_targs [] int8 = [] int8 { 0, 0 } +var _foo_nfa_offsets [] int8 = [] int8 { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } +var _foo_nfa_push_actions [] int8 = [] int8 { 0, 0 } +var _foo_nfa_pop_trans [] int8 = [] int8 { 0, 0 } +var foo_start int = 1 +var foo_first_final int = 15 +var foo_error int = 0 +var foo_en_main int = 1 +func prepare() { + + { + cs = int(foo_start); + } +} + +func exec(data string) { + var p int = 0 + var pe int = len(data) + + { + var _acts int + var _nacts uint + var _nbreak int + if p == pe { + goto _test_eof; + + } + if cs == 0 { + goto _out; + + } + _resume: + switch cs { + case 1: + if 48 <= ( data[p ]) && ( data[p ]) <= 49 { + { + goto ctr0; + } + + } + { + goto ctr1; + } + case 0: + goto _out; + case 2: + if 48 <= ( data[p ]) && ( data[p ]) <= 49 { + { + goto ctr2; + } + + } + { + goto ctr1; + } + case 3: + if 48 <= ( data[p ]) && ( data[p ]) <= 49 { + { + goto ctr3; + } + + } + { + goto ctr1; + } + case 4: + switch ( data[p ]) { + case 97: + { + goto ctr4; + } + case 98: + { + var ck int = 0 + if (j != 0) { + ck += 1; + + } + if 1 <= ck { + { goto ctr5; + } + + } + goto ctr6; + + } + + } + { + goto ctr1; + } + case 5: + switch ( data[p ]) { + case 97: + { + goto ctr7; + } + case 98: + { + var ck int = 0 + if (i != 0) { + ck += 1; + + } + if (j != 0) { + ck += 2; + + } + if (k != 0) { + ck += 4; + + } + switch { + case ck < 4 : + { + switch { + case ck < 2 : + { + if 1 <= ck { + { goto ctr8; + } + + } + } + case ck > 2 : + { + goto ctr9; + } + default: + { + goto ctr5; + } + + } + } + case ck > 4 : + { + switch { + case ck < 6 : + { + goto ctr11; + } + case ck > 6 : + { + goto ctr13; + } + default: + { + goto ctr12; + } + + } + } + default: + { + goto ctr10; + } + + } + goto ctr6; + + } + + } + { + goto ctr1; + } + case 6: + switch ( data[p ]) { + case 97: + { + goto ctr7; + } + case 98: + { + var ck int = 0 + if (j != 0) { + ck += 1; + + } + if (k != 0) { + ck += 2; + + } + switch { + case ck < 2 : + { + if 1 <= ck { + { goto ctr5; + } + + } + } + case ck > 2 : + { + goto ctr12; + } + default: + { + goto ctr10; + } + + } + goto ctr6; + + } + + } + { + goto ctr1; + } + case 7: + if ( data[p ]) == 99 { + { + goto ctr14; + } + + } + { + goto ctr1; + } + case 8: + if ( data[p ]) == 10 { + { + goto ctr15; + } + + } + { + goto ctr1; + } + case 15: + { + goto ctr1; + } + case 9: + if ( data[p ]) == 99 { + { + goto ctr16; + } + + } + { + goto ctr1; + } + case 10: + if ( data[p ]) == 99 { + { + goto ctr17; + } + + } + { + goto ctr1; + } + case 11: + if ( data[p ]) == 99 { + { + goto ctr18; + } + + } + { + goto ctr1; + } + case 12: + if ( data[p ]) == 99 { + { + goto ctr19; + } + + } + { + goto ctr1; + } + case 13: + if ( data[p ]) == 99 { + { + goto ctr20; + } + + } + { + goto ctr1; + } + case 14: + if ( data[p ]) == 99 { + { + goto ctr21; + } + + } + { + goto ctr1; + } + + } + ctr1: cs = 0; + goto _again; + ctr0: cs = 2; + goto f0; + ctr2: cs = 3; + goto f1; + ctr3: cs = 4; + goto f2; + ctr4: cs = 5; + goto _again; + ctr7: cs = 6; + goto _again; + ctr14: cs = 8; + goto f3; + ctr16: cs = 8; + goto f5; + ctr17: cs = 8; + goto f6; + ctr18: cs = 8; + goto f7; + ctr19: cs = 8; + goto f8; + ctr20: cs = 8; + goto f9; + ctr21: cs = 8; + goto f10; + ctr15: cs = 15; + goto f4; + ctr6: cs = 0; + goto _again; + ctr5: cs = 7; + goto _again; + ctr10: cs = 9; + goto _again; + ctr12: cs = 10; + goto _again; + ctr8: cs = 11; + goto _again; + ctr9: cs = 12; + goto _again; + ctr11: cs = 13; + goto _again; + ctr13: cs = 14; + goto _again; + + f7: _acts = int(1 ); + goto execFuncs; + f3: _acts = int(3 ); + goto execFuncs; + f5: _acts = int(5 ); + goto execFuncs; + f0: _acts = int(7 ); + goto execFuncs; + f1: _acts = int(9 ); + goto execFuncs; + f2: _acts = int(11 ); + goto execFuncs; + f4: _acts = int(13 ); + goto execFuncs; + f8: _acts = int(15 ); + goto execFuncs; + f9: _acts = int(18 ); + goto execFuncs; + f6: _acts = int(21 ); + goto execFuncs; + f10: _acts = int(24 ); + goto execFuncs; + + execFuncs: + _nbreak = 0; + _nacts = uint(_foo_actions[_acts ]); + _acts += 1; + for _nacts > 0 { + { + switch _foo_actions[_acts ] { + case 0: + {fmt.Print( " one\n" );} + + break; + case 1: + {fmt.Print( " two\n" );} + + break; + case 2: + {fmt.Print( " three\n" );} + + break; + case 3: + {if ( (( data[p ])) == 48 ) { + i = 0; + + } else { + i = 1; + + } + } + + break; + case 4: + {if ( (( data[p ])) == 48 ) { + j = 0; + + } else { + j = 1; + + } + } + + break; + case 5: + {if ( (( data[p ])) == 48 ) { + k = 0; + + } else { + k = 1; + + } + } + + break; + case 6: + {{p += 1; + _nbreak = 1; + } + } + + break; + + } + _acts += 1; + _nacts -= 1; + } + + + } + if _nbreak == 1 { + goto _out; + + } + goto _again; + + _again: + if cs == 0 { + goto _out; + + } + p += 1; + if p != pe { + goto _resume; + + } + _test_eof: {} + _out: {} + } +} +func finish() { + if cs >= foo_first_final { + fmt.Println("ACCEPT") + } else { + fmt.Println("FAIL") + } +} +var inp []string = []string { + "000abc\n", + "100abc\n", + "010abc\n", + "110abc\n", + "001abc\n", + "101abc\n", + "011abc\n", + "111abc\n", +}; + +func main() { + for _, data := range inp { + prepare() + exec(data) + finish() + } +} |