static mut i : i8 = 0; static mut j : i8 = 0; static mut k : i8 = 0; static _foo_actions: [i8 ; 30] = [ 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 , 0 ]; static _foo_trans_keys: [u8 ; 34] = [ 1, 0, 2, 2, 2, 2, 2, 2, 3, 4, 3, 4, 3, 4, 5, 5, 0, 0, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 1, 0, 0 , 0 ]; static _foo_char_class: [i8 ; 92] = [ 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 4, 5, 0 , 0 ]; static _foo_index_offsets: [i8 ; 18] = [ 0, 0, 1, 2, 3, 5, 7, 9, 10, 11, 12, 13, 14, 15, 16, 17, 0 , 0 ]; static _foo_indicies: [i8 ; 19] = [ 0, 2, 3, 4, 5, 6, 7, 6, 8, 9, 10, 11, 12, 13, 14, 15, 16, 0 , 0 ]; static _foo_index_defaults: [i8 ; 18] = [ 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0 , 0 ]; static _foo_trans_cond_spaces: [i8 ; 19] = [ -1, -1, -1, -1, -1, 1, -1, 5, 4, -1, -1, -1, -1, -1, -1, -1, -1, 0 , 0 ]; static _foo_trans_offsets: [i8 ; 19] = [ 0, 1, 2, 3, 4, 5, 7, 8, 16, 20, 21, 22, 23, 24, 25, 26, 27, 0 , 0 ]; static _foo_cond_targs: [i8 ; 30] = [ 2, 0, 3, 4, 5, 0, 7, 6, 0, 11, 7, 12, 9, 13, 10, 14, 0, 7, 9, 10, 8, 15, 8, 8, 8, 8, 8, 8, 0 , 0 ]; static _foo_cond_actions: [i8 ; 30] = [ 7, 0, 9, 11, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 13, 5, 21, 1, 15, 18, 24, 0 , 0 ]; static _foo_nfa_targs: [i8 ; 3] = [ 0, 0 , 0 ]; static _foo_nfa_offsets: [i8 ; 18] = [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 , 0 ]; static _foo_nfa_push_actions: [i8 ; 3] = [ 0, 0 , 0 ]; static _foo_nfa_pop_trans: [i8 ; 3] = [ 0, 0 , 0 ]; static foo_start : i32 = 1; static foo_first_final : i32 = 15; static foo_error : i32 = 0; static foo_en_main : i32 = 1; unsafe fn m( s: String ) { let data: &[u8] = s.as_bytes(); let mut p:i32 = 0; let mut pe:i32 = s.len() as i32; let mut eof:i32 = s.len() as i32; let mut cs: i32 = 0; let mut buffer = String::new(); { cs = ( foo_start ) as i32; } { let mut _trans = 0; let mut _have = 0; let mut _cont = 1; let mut _cond = 0; let mut _acts :i32 = 0; let mut _nacts = 0; let mut _keys :i32 = 0; let mut _inds :i32 = 0; let mut _cpc = 0; while ( _cont == 1 ) { if ( cs == 0 ) { _cont = 0; } _have = 0; if ( p == pe ) { { if ( _have == 0 ) { _cont = 0; } } } if ( _cont == 1 ) { { if ( _have == 0 ) { { _keys = ( (cs<<1) ) as i32; _inds = ( _foo_index_offsets[(cs) as usize] ) as i32; if ( ( data[(p ) as usize] ) <= 99 && ( data[(p ) as usize] ) >= 10 ) { { let mut _ic = ( _foo_char_class[(( ( data[(p ) as usize] ) ) as i32- 10) as usize] ) as i32; if ( _ic <= ( _foo_trans_keys[(_keys+1 ) as usize] ) as i32&& _ic >= ( _foo_trans_keys[(_keys ) as usize] ) as i32 ) { _trans = ( _foo_indicies[(_inds + ( ( _ic - ( _foo_trans_keys[(_keys ) as usize] ) as i32) ) as i32) as usize] ) as u32; } else { _trans = ( _foo_index_defaults[(cs) as usize] ) as u32; } } } else { { _trans = ( _foo_index_defaults[(cs) as usize] ) as u32; } } _cond = ( _foo_trans_offsets[(_trans) as usize] ) as u32; _cpc = 0; match ( _foo_trans_cond_spaces[(_trans) as usize] ) { 0 => { if ( (i != 0) ) { _cpc += 1; } } 1 => { if ( (j != 0) ) { _cpc += 1; } } 2 => { if ( (k != 0) ) { _cpc += 1; } } 3 => { if ( (i != 0) ) { _cpc += 1; } if ( (j != 0) ) { _cpc += 2; } } 4 => { if ( (j != 0) ) { _cpc += 1; } if ( (k != 0) ) { _cpc += 2; } } 5 => { if ( (i != 0) ) { _cpc += 1; } if ( (j != 0) ) { _cpc += 2; } if ( (k != 0) ) { _cpc += 4; } } _ => {} } _cond += ( _cpc ) as u32; } } if ( _cont == 1 ) { { cs = ( _foo_cond_targs[(_cond) as usize] ) as i32; if ( _foo_cond_actions[(_cond) as usize]!= 0 ) { { _acts = ( _foo_cond_actions[(_cond) as usize] ) as i32; _nacts = ( _foo_actions[(_acts ) as usize] ) as u32; _acts += 1; while ( _nacts > 0 ) { match ( _foo_actions[(_acts ) as usize] ) { 0 => { {print!( "{}", " one\n" ); } } 1 => { {print!( "{}", " two\n" ); } } 2 => { {print!( "{}", " three\n" ); } } 3 => { {if ( (( data[(p ) as usize] )) == 48 ) { i = 0; } else { i = 1; } } } 4 => { {if ( (( data[(p ) as usize] )) == 48 ) { j = 0; } else { j = 1; } } } 5 => { {if ( (( data[(p ) as usize] )) == 48 ) { k = 0; } else { k = 1; } } } 6 => { {{p+= 1; _cont = 0; }} } _ => {} } _nacts -= 1; _acts += 1; } } } if ( cs == 0 ) { _cont = 0; } if ( _cont == 1 ) { p += 1; } } } } } } } if ( cs >= foo_first_final ) { println!( "ACCEPT" ); } else { println!( "FAIL" ); } } fn main() { unsafe { m( "000abc\n".to_string() ); } unsafe { m( "100abc\n".to_string() ); } unsafe { m( "010abc\n".to_string() ); } unsafe { m( "110abc\n".to_string() ); } unsafe { m( "001abc\n".to_string() ); } unsafe { m( "101abc\n".to_string() ); } unsafe { m( "011abc\n".to_string() ); } unsafe { m( "111abc\n".to_string() ); } }