diff options
Diffstat (limited to 'test/rlhc.d/case/keller1.cpp-C-G0--goto-backend.exp')
-rw-r--r-- | test/rlhc.d/case/keller1.cpp-C-G0--goto-backend.exp | 2496 |
1 files changed, 2496 insertions, 0 deletions
diff --git a/test/rlhc.d/case/keller1.cpp-C-G0--goto-backend.exp b/test/rlhc.d/case/keller1.cpp-C-G0--goto-backend.exp new file mode 100644 index 00000000..a45a3f7d --- /dev/null +++ b/test/rlhc.d/case/keller1.cpp-C-G0--goto-backend.exp @@ -0,0 +1,2496 @@ +#line 1 "tmp.gmr" +#include <iostream> +using std::cout; +using std::endl; + + +#line 16 "tmp.rl" +enum token_type_e { + tt_id, + tt_equals, + tt_semi, + tt_pipe, + tt_amp, + tt_minus, + tt_dot, + tt_colon, + tt_percent, + tt_dollar, + tt_plus, + tt_number, + tt_star, + tt_question, + tt_not, + tt_andFSM, + tt_orFSM, + tt_open, + tt_close +}; + +struct LangEl +{ + int line, lineEnd; + int pos; + + int type; + int state; + LangEl *prev, *next; +}; + +struct Token : public LangEl +{ + const char *value; +}; + +struct Lel_start : public LangEl +{ + #line 32 "tmp.gmr" + + int si; + #line 59 "tmp.rl" +}; + +struct Lel_M : public LangEl +{ + #line 36 "tmp.gmr" + + int mi; + #line 67 "tmp.rl" +}; + +#define l__error 19 +#define l_tt_id 0 +#define l_tt_equals 1 +#define l_tt_semi 2 +#define l_tt_pipe 3 +#define l_tt_amp 4 +#define l_tt_minus 5 +#define l_tt_dot 6 +#define l_tt_colon 7 +#define l_tt_percent 8 +#define l_tt_dollar 9 +#define l_tt_plus 10 +#define l_tt_number 11 +#define l_tt_star 12 +#define l_tt_question 13 +#define l_tt_not 14 +#define l_tt_andFSM 15 +#define l_tt_orFSM 16 +#define l_tt_open 17 +#define l_tt_close 18 +#define l_start 23 +#define l_M 24 +#define l_A 25 +#define l_E 26 +#define l_T 27 +#define l_N 28 +#define l_K 29 +#define l_F 30 +#define l__start 31 +#define l__eof 20 + +struct LangEl; + +struct Parser +{ + Parser(); + + void parseLangEl( LangEl *langEl ); + int done( ); + + void push( LangEl *lel ) { + lel->prev = stack; + stack = lel; + } + LangEl *pop() { + LangEl *ret = stack; + stack = stack->prev; + return ret; + } + int pop( int n ); + void rem( LangEl *lel, int n ); + LangEl *stack; + int next; + LangEl *redLel; + LangEl *rhs[10]; + + int cs; + + // Initialize the machine. Invokes any init statement blocks. Returns 0 + // if the machine begins in a non-accepting state and 1 if the machine + // begins in an accepting state. + int init( ); + + // Execute the machine on a block of data. Returns -1 if after processing + // the data, the machine is in the error state and can never accept, 0 if + // the machine is in a non-accepting state and 1 if the machine is in an + // accepting state. + int execute( LangEl *data, int len ); + + // Indicate that there is no more data. Returns -1 if the machine finishes + // in the error state and does not accept, 0 if the machine finishes + // in any other non-accepting state and 1 if the machine finishes in an + // accepting state. + int finish( ); +}; + + + + +static const char _Parser_actions [] = { 0, 1, 0, 4, 1, 5, 17, 13, 4, 1, 6, 19, 13, 4, 1, 8, 24, 13, 4, 1, 9, 27, 13, 4, 1, 10, 37, 13, 4, 1, 11, 41, 13, 4, 1, 12, 46, 13, 4, 1, 12, 47, 13, 4, 1, 12, 48, 13, 4, 2, 6, 18, 14, 4, 2, 9, 26, 14, 4, 2, 11, 38, 14, 4, 2, 11, 39, 14, 4, 2, 11, 40, 14, 4, 2, 11, 45, 14, 4, 3, 8, 21, 15, 4, 3, 8, 22, 15, 4, 3, 8, 23, 15, 4, 3, 9, 25, 15, 4, 3, 10, 28, 15, 4, 3, 10, 29, 15, 4, 3, 10, 30, 15, 4, 3, 11, 42, 15, 4, 3, 11, 43, 15, 4, 3, 11, 44, 15, 4, 3, 12, 49, 15, 4, 4, 7, 20, 16, 4, 4, 10, 31, 16, 4, 4, 10, 32, 16, 4, 4, 10, 33, 16, 4, 4, 10, 34, 16, 4, 4, 10, 35, 16, 4, 4, 10, 36, 16, 0 , }; +static const char _Parser_nfa_targs [] = { 0, 0 , }; +static const char _Parser_nfa_offsets [] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 , }; +static const char _Parser_nfa_push_actions [] = { 0, 0 , }; +static const char _Parser_nfa_pop_trans [] = { 0, 0 , }; +static const int Parser_start = 1; +static const int Parser_first_final = 55; +static const int Parser_error = 0; +static const int Parser_en_main = 1; +Parser::Parser( ) +{ } + +int Parser::init( ) +{ + + { + cs = ( int ) Parser_start; + } + return 0; +} + +int Parser::execute( LangEl *_data, int _len ) +{ + LangEl *p = _data; + LangEl *pe = _data+_len; + + { + int _ps = 0; + const char *_acts; + unsigned int _nacts; + + if ( p == pe ) + goto _test_eof; + + if ( cs == 0 ) + goto _out; + + _resume: + switch ( cs ) { + case 1: + switch ( (p->type) ) { + case 0: + { + goto ctr0; + } + case 23: + { + goto ctr2; + } + case 24: + { + goto ctr3; + } + case 25: + { + goto ctr4; + } + + } + { + goto ctr1; + } + case 0: + goto _out; + case 2: + if ( (p->type) == 1 ) + { + goto ctr5; + } + + { + goto ctr1; + } + case 3: + switch ( (p->type) ) { + case 0: + { + goto ctr6; + } + case 14: + { + goto ctr7; + } + case 15: + { + goto ctr8; + } + case 16: + { + goto ctr9; + } + case 17: + { + goto ctr10; + } + case 26: + { + goto ctr11; + } + case 27: + { + goto ctr12; + } + case 28: + { + goto ctr13; + } + case 29: + { + goto ctr14; + } + case 30: + { + goto ctr15; + } + + } + { + goto ctr1; + } + case 4: + if ( (p->type) == 0 ) + { + goto ctr16; + } + + if ( (p->type) > 10 ) + { + if ( 12 <= (p->type) && (p->type) <= 18 ) + { + goto ctr16; + } + + } + else if ( (p->type) >= 2 ) + { + goto ctr16; + } + + { + goto ctr1; + } + case 55: + { + goto ctr1; + } + case 5: + switch ( (p->type) ) { + case 0: + { + goto ctr6; + } + case 15: + { + goto ctr8; + } + case 16: + { + goto ctr9; + } + case 17: + { + goto ctr10; + } + case 30: + { + goto ctr17; + } + + } + { + goto ctr1; + } + case 6: + if ( (p->type) == 0 ) + { + goto ctr18; + } + + if ( (p->type) > 10 ) + { + if ( 12 <= (p->type) && (p->type) <= 18 ) + { + goto ctr18; + } + + } + else if ( (p->type) >= 2 ) + { + goto ctr18; + } + + { + goto ctr1; + } + case 7: + if ( (p->type) == 0 ) + { + goto ctr19; + } + + if ( (p->type) > 10 ) + { + if ( 12 <= (p->type) && (p->type) <= 18 ) + { + goto ctr19; + } + + } + else if ( (p->type) >= 2 ) + { + goto ctr19; + } + + { + goto ctr1; + } + case 8: + switch ( (p->type) ) { + case 0: + { + goto ctr6; + } + case 14: + { + goto ctr7; + } + case 15: + { + goto ctr8; + } + case 16: + { + goto ctr9; + } + case 17: + { + goto ctr10; + } + case 26: + { + goto ctr20; + } + case 27: + { + goto ctr12; + } + case 28: + { + goto ctr13; + } + case 29: + { + goto ctr14; + } + case 30: + { + goto ctr15; + } + + } + { + goto ctr1; + } + case 9: + switch ( (p->type) ) { + case 3: + { + goto ctr21; + } + case 4: + { + goto ctr22; + } + case 5: + { + goto ctr23; + } + case 18: + { + goto ctr24; + } + + } + { + goto ctr1; + } + case 10: + switch ( (p->type) ) { + case 0: + { + goto ctr6; + } + case 14: + { + goto ctr7; + } + case 15: + { + goto ctr8; + } + case 16: + { + goto ctr9; + } + case 17: + { + goto ctr10; + } + case 27: + { + goto ctr25; + } + case 28: + { + goto ctr13; + } + case 29: + { + goto ctr14; + } + case 30: + { + goto ctr15; + } + + } + { + goto ctr1; + } + case 11: + switch ( (p->type) ) { + case 0: + { + goto ctr6; + } + case 6: + { + goto ctr27; + } + case 14: + { + goto ctr7; + } + case 15: + { + goto ctr8; + } + case 16: + { + goto ctr9; + } + case 17: + { + goto ctr10; + } + case 18: + { + goto ctr26; + } + case 28: + { + goto ctr28; + } + case 29: + { + goto ctr14; + } + case 30: + { + goto ctr15; + } + + } + if ( 2 <= (p->type) && (p->type) <= 5 ) + { + goto ctr26; + } + + { + goto ctr1; + } + case 12: + switch ( (p->type) ) { + case 0: + { + goto ctr6; + } + case 14: + { + goto ctr7; + } + case 15: + { + goto ctr8; + } + case 16: + { + goto ctr9; + } + case 17: + { + goto ctr10; + } + case 28: + { + goto ctr29; + } + case 29: + { + goto ctr14; + } + case 30: + { + goto ctr15; + } + + } + { + goto ctr1; + } + case 13: + switch ( (p->type) ) { + case 0: + { + goto ctr30; + } + case 7: + { + goto ctr31; + } + case 8: + { + goto ctr32; + } + case 9: + { + goto ctr33; + } + + } + if ( (p->type) > 6 ) + { + if ( 14 <= (p->type) && (p->type) <= 18 ) + { + goto ctr30; + } + + } + else if ( (p->type) >= 2 ) + { + goto ctr30; + } + + { + goto ctr1; + } + case 14: + switch ( (p->type) ) { + case 0: + { + goto ctr34; + } + case 5: + { + goto ctr35; + } + case 10: + { + goto ctr36; + } + + } + { + goto ctr1; + } + case 15: + if ( (p->type) == 0 ) + { + goto ctr37; + } + + if ( (p->type) > 9 ) + { + if ( 14 <= (p->type) && (p->type) <= 18 ) + { + goto ctr37; + } + + } + else if ( (p->type) >= 2 ) + { + goto ctr37; + } + + { + goto ctr1; + } + case 16: + if ( (p->type) == 11 ) + { + goto ctr38; + } + + { + goto ctr1; + } + case 17: + if ( (p->type) == 0 ) + { + goto ctr39; + } + + if ( (p->type) > 9 ) + { + if ( 14 <= (p->type) && (p->type) <= 18 ) + { + goto ctr39; + } + + } + else if ( (p->type) >= 2 ) + { + goto ctr39; + } + + { + goto ctr1; + } + case 18: + if ( (p->type) == 11 ) + { + goto ctr40; + } + + { + goto ctr1; + } + case 19: + if ( (p->type) == 0 ) + { + goto ctr41; + } + + if ( (p->type) > 9 ) + { + if ( 14 <= (p->type) && (p->type) <= 18 ) + { + goto ctr41; + } + + } + else if ( (p->type) >= 2 ) + { + goto ctr41; + } + + { + goto ctr1; + } + case 20: + switch ( (p->type) ) { + case 0: + { + goto ctr42; + } + case 5: + { + goto ctr43; + } + case 10: + { + goto ctr44; + } + + } + { + goto ctr1; + } + case 21: + if ( (p->type) == 0 ) + { + goto ctr45; + } + + if ( (p->type) > 9 ) + { + if ( 14 <= (p->type) && (p->type) <= 18 ) + { + goto ctr45; + } + + } + else if ( (p->type) >= 2 ) + { + goto ctr45; + } + + { + goto ctr1; + } + case 22: + if ( (p->type) == 11 ) + { + goto ctr46; + } + + { + goto ctr1; + } + case 23: + if ( (p->type) == 0 ) + { + goto ctr47; + } + + if ( (p->type) > 9 ) + { + if ( 14 <= (p->type) && (p->type) <= 18 ) + { + goto ctr47; + } + + } + else if ( (p->type) >= 2 ) + { + goto ctr47; + } + + { + goto ctr1; + } + case 24: + if ( (p->type) == 11 ) + { + goto ctr48; + } + + { + goto ctr1; + } + case 25: + if ( (p->type) == 0 ) + { + goto ctr49; + } + + if ( (p->type) > 9 ) + { + if ( 14 <= (p->type) && (p->type) <= 18 ) + { + goto ctr49; + } + + } + else if ( (p->type) >= 2 ) + { + goto ctr49; + } + + { + goto ctr1; + } + case 26: + switch ( (p->type) ) { + case 0: + { + goto ctr50; + } + case 5: + { + goto ctr51; + } + case 10: + { + goto ctr52; + } + + } + { + goto ctr1; + } + case 27: + if ( (p->type) == 0 ) + { + goto ctr53; + } + + if ( (p->type) > 9 ) + { + if ( 14 <= (p->type) && (p->type) <= 18 ) + { + goto ctr53; + } + + } + else if ( (p->type) >= 2 ) + { + goto ctr53; + } + + { + goto ctr1; + } + case 28: + if ( (p->type) == 11 ) + { + goto ctr54; + } + + { + goto ctr1; + } + case 29: + if ( (p->type) == 0 ) + { + goto ctr55; + } + + if ( (p->type) > 9 ) + { + if ( 14 <= (p->type) && (p->type) <= 18 ) + { + goto ctr55; + } + + } + else if ( (p->type) >= 2 ) + { + goto ctr55; + } + + { + goto ctr1; + } + case 30: + if ( (p->type) == 11 ) + { + goto ctr56; + } + + { + goto ctr1; + } + case 31: + if ( (p->type) == 0 ) + { + goto ctr57; + } + + if ( (p->type) > 9 ) + { + if ( 14 <= (p->type) && (p->type) <= 18 ) + { + goto ctr57; + } + + } + else if ( (p->type) >= 2 ) + { + goto ctr57; + } + + { + goto ctr1; + } + case 32: + if ( (p->type) == 0 ) + { + goto ctr58; + } + + if ( (p->type) > 9 ) + { + if ( 14 <= (p->type) && (p->type) <= 18 ) + { + goto ctr58; + } + + } + else if ( (p->type) >= 2 ) + { + goto ctr58; + } + + { + goto ctr1; + } + case 33: + switch ( (p->type) ) { + case 0: + { + goto ctr59; + } + case 10: + { + goto ctr60; + } + case 12: + { + goto ctr61; + } + case 13: + { + goto ctr62; + } + + } + if ( (p->type) > 9 ) + { + if ( 14 <= (p->type) && (p->type) <= 18 ) + { + goto ctr59; + } + + } + else if ( (p->type) >= 2 ) + { + goto ctr59; + } + + { + goto ctr1; + } + case 34: + if ( (p->type) == 0 ) + { + goto ctr63; + } + + if ( (p->type) > 9 ) + { + if ( 14 <= (p->type) && (p->type) <= 18 ) + { + goto ctr63; + } + + } + else if ( (p->type) >= 2 ) + { + goto ctr63; + } + + { + goto ctr1; + } + case 35: + if ( (p->type) == 0 ) + { + goto ctr64; + } + + if ( (p->type) > 9 ) + { + if ( 14 <= (p->type) && (p->type) <= 18 ) + { + goto ctr64; + } + + } + else if ( (p->type) >= 2 ) + { + goto ctr64; + } + + { + goto ctr1; + } + case 36: + if ( (p->type) == 0 ) + { + goto ctr65; + } + + if ( (p->type) > 9 ) + { + if ( 14 <= (p->type) && (p->type) <= 18 ) + { + goto ctr65; + } + + } + else if ( (p->type) >= 2 ) + { + goto ctr65; + } + + { + goto ctr1; + } + case 37: + switch ( (p->type) ) { + case 0: + { + goto ctr66; + } + case 7: + { + goto ctr31; + } + case 8: + { + goto ctr32; + } + case 9: + { + goto ctr33; + } + + } + if ( (p->type) > 6 ) + { + if ( 14 <= (p->type) && (p->type) <= 18 ) + { + goto ctr66; + } + + } + else if ( (p->type) >= 2 ) + { + goto ctr66; + } + + { + goto ctr1; + } + case 38: + switch ( (p->type) ) { + case 0: + { + goto ctr67; + } + case 7: + { + goto ctr31; + } + case 8: + { + goto ctr32; + } + case 9: + { + goto ctr33; + } + + } + if ( (p->type) > 6 ) + { + if ( 14 <= (p->type) && (p->type) <= 18 ) + { + goto ctr67; + } + + } + else if ( (p->type) >= 2 ) + { + goto ctr67; + } + + { + goto ctr1; + } + case 39: + switch ( (p->type) ) { + case 0: + { + goto ctr6; + } + case 14: + { + goto ctr7; + } + case 15: + { + goto ctr8; + } + case 16: + { + goto ctr9; + } + case 17: + { + goto ctr10; + } + case 27: + { + goto ctr68; + } + case 28: + { + goto ctr13; + } + case 29: + { + goto ctr14; + } + case 30: + { + goto ctr15; + } + + } + { + goto ctr1; + } + case 40: + switch ( (p->type) ) { + case 0: + { + goto ctr6; + } + case 6: + { + goto ctr27; + } + case 14: + { + goto ctr7; + } + case 15: + { + goto ctr8; + } + case 16: + { + goto ctr9; + } + case 17: + { + goto ctr10; + } + case 18: + { + goto ctr69; + } + case 28: + { + goto ctr28; + } + case 29: + { + goto ctr14; + } + case 30: + { + goto ctr15; + } + + } + if ( 2 <= (p->type) && (p->type) <= 5 ) + { + goto ctr69; + } + + { + goto ctr1; + } + case 41: + switch ( (p->type) ) { + case 0: + { + goto ctr6; + } + case 14: + { + goto ctr7; + } + case 15: + { + goto ctr8; + } + case 16: + { + goto ctr9; + } + case 17: + { + goto ctr10; + } + case 27: + { + goto ctr70; + } + case 28: + { + goto ctr13; + } + case 29: + { + goto ctr14; + } + case 30: + { + goto ctr15; + } + + } + { + goto ctr1; + } + case 42: + switch ( (p->type) ) { + case 0: + { + goto ctr6; + } + case 6: + { + goto ctr27; + } + case 14: + { + goto ctr7; + } + case 15: + { + goto ctr8; + } + case 16: + { + goto ctr9; + } + case 17: + { + goto ctr10; + } + case 18: + { + goto ctr71; + } + case 28: + { + goto ctr28; + } + case 29: + { + goto ctr14; + } + case 30: + { + goto ctr15; + } + + } + if ( 2 <= (p->type) && (p->type) <= 5 ) + { + goto ctr71; + } + + { + goto ctr1; + } + case 43: + if ( (p->type) == 0 ) + { + goto ctr72; + } + + if ( (p->type) > 10 ) + { + if ( 12 <= (p->type) && (p->type) <= 18 ) + { + goto ctr72; + } + + } + else if ( (p->type) >= 2 ) + { + goto ctr72; + } + + { + goto ctr1; + } + case 44: + switch ( (p->type) ) { + case 0: + { + goto ctr6; + } + case 6: + { + goto ctr27; + } + case 14: + { + goto ctr7; + } + case 15: + { + goto ctr8; + } + case 16: + { + goto ctr9; + } + case 17: + { + goto ctr10; + } + case 18: + { + goto ctr73; + } + case 28: + { + goto ctr28; + } + case 29: + { + goto ctr14; + } + case 30: + { + goto ctr15; + } + + } + if ( 2 <= (p->type) && (p->type) <= 5 ) + { + goto ctr73; + } + + { + goto ctr1; + } + case 45: + switch ( (p->type) ) { + case 0: + { + goto ctr74; + } + case 10: + { + goto ctr75; + } + case 12: + { + goto ctr76; + } + case 13: + { + goto ctr77; + } + + } + if ( (p->type) > 9 ) + { + if ( 14 <= (p->type) && (p->type) <= 18 ) + { + goto ctr74; + } + + } + else if ( (p->type) >= 2 ) + { + goto ctr74; + } + + { + goto ctr1; + } + case 46: + if ( (p->type) == 0 ) + { + goto ctr78; + } + + if ( (p->type) > 9 ) + { + if ( 14 <= (p->type) && (p->type) <= 18 ) + { + goto ctr78; + } + + } + else if ( (p->type) >= 2 ) + { + goto ctr78; + } + + { + goto ctr1; + } + case 47: + if ( (p->type) == 0 ) + { + goto ctr79; + } + + if ( (p->type) > 9 ) + { + if ( 14 <= (p->type) && (p->type) <= 18 ) + { + goto ctr79; + } + + } + else if ( (p->type) >= 2 ) + { + goto ctr79; + } + + { + goto ctr1; + } + case 48: + if ( (p->type) == 0 ) + { + goto ctr80; + } + + if ( (p->type) > 9 ) + { + if ( 14 <= (p->type) && (p->type) <= 18 ) + { + goto ctr80; + } + + } + else if ( (p->type) >= 2 ) + { + goto ctr80; + } + + { + goto ctr1; + } + case 49: + switch ( (p->type) ) { + case 2: + { + goto ctr81; + } + case 3: + { + goto ctr21; + } + case 4: + { + goto ctr22; + } + case 5: + { + goto ctr23; + } + + } + { + goto ctr1; + } + case 50: + switch ( (p->type) ) { + case 0: + { + goto ctr82; + } + case 20: + { + goto ctr82; + } + + } + { + goto ctr1; + } + case 51: + if ( (p->type) == 20 ) + { + goto ctr83; + } + + { + goto ctr1; + } + case 52: + switch ( (p->type) ) { + case 0: + { + goto ctr0; + } + case 20: + { + goto ctr84; + } + case 25: + { + goto ctr85; + } + + } + { + goto ctr1; + } + case 53: + switch ( (p->type) ) { + case 0: + { + goto ctr86; + } + case 20: + { + goto ctr86; + } + + } + { + goto ctr1; + } + case 54: + switch ( (p->type) ) { + case 0: + { + goto ctr87; + } + case 20: + { + goto ctr87; + } + + } + { + goto ctr1; + } + + } + ctr1: cs = 0; + goto _again; + ctr0: _ps = cs; + cs = 2; + goto f0; + ctr5: _ps = cs; + cs = 3; + goto f0; + ctr6: _ps = cs; + cs = 4; + goto f0; + ctr7: _ps = cs; + cs = 5; + goto f0; + ctr8: _ps = cs; + cs = 6; + goto f0; + ctr9: _ps = cs; + cs = 7; + goto f0; + ctr10: _ps = cs; + cs = 8; + goto f0; + ctr20: _ps = cs; + cs = 9; + goto f0; + ctr21: _ps = cs; + cs = 10; + goto f0; + ctr25: _ps = cs; + cs = 11; + goto f0; + ctr27: _ps = cs; + cs = 12; + goto f0; + ctr29: _ps = cs; + cs = 13; + goto f0; + ctr31: _ps = cs; + cs = 14; + goto f0; + ctr34: _ps = cs; + cs = 15; + goto f0; + ctr35: _ps = cs; + cs = 16; + goto f0; + ctr38: _ps = cs; + cs = 17; + goto f0; + ctr36: _ps = cs; + cs = 18; + goto f0; + ctr40: _ps = cs; + cs = 19; + goto f0; + ctr32: _ps = cs; + cs = 20; + goto f0; + ctr42: _ps = cs; + cs = 21; + goto f0; + ctr43: _ps = cs; + cs = 22; + goto f0; + ctr46: _ps = cs; + cs = 23; + goto f0; + ctr44: _ps = cs; + cs = 24; + goto f0; + ctr48: _ps = cs; + cs = 25; + goto f0; + ctr33: _ps = cs; + cs = 26; + goto f0; + ctr50: _ps = cs; + cs = 27; + goto f0; + ctr51: _ps = cs; + cs = 28; + goto f0; + ctr54: _ps = cs; + cs = 29; + goto f0; + ctr52: _ps = cs; + cs = 30; + goto f0; + ctr56: _ps = cs; + cs = 31; + goto f0; + ctr14: _ps = cs; + cs = 32; + goto f0; + ctr15: _ps = cs; + cs = 33; + goto f0; + ctr60: _ps = cs; + cs = 34; + goto f0; + ctr61: _ps = cs; + cs = 35; + goto f0; + ctr62: _ps = cs; + cs = 36; + goto f0; + ctr28: _ps = cs; + cs = 37; + goto f0; + ctr13: _ps = cs; + cs = 38; + goto f0; + ctr22: _ps = cs; + cs = 39; + goto f0; + ctr68: _ps = cs; + cs = 40; + goto f0; + ctr23: _ps = cs; + cs = 41; + goto f0; + ctr70: _ps = cs; + cs = 42; + goto f0; + ctr24: _ps = cs; + cs = 43; + goto f0; + ctr12: _ps = cs; + cs = 44; + goto f0; + ctr17: _ps = cs; + cs = 45; + goto f0; + ctr75: _ps = cs; + cs = 46; + goto f0; + ctr76: _ps = cs; + cs = 47; + goto f0; + ctr77: _ps = cs; + cs = 48; + goto f0; + ctr11: _ps = cs; + cs = 49; + goto f0; + ctr81: _ps = cs; + cs = 50; + goto f0; + ctr2: _ps = cs; + cs = 51; + goto f0; + ctr3: _ps = cs; + cs = 52; + goto f0; + ctr85: _ps = cs; + cs = 53; + goto f0; + ctr4: _ps = cs; + cs = 54; + goto f0; + ctr83: _ps = cs; + cs = 55; + goto f0; + ctr16: cs = 55; + goto f1; + ctr18: cs = 55; + goto f2; + ctr19: cs = 55; + goto f3; + ctr26: cs = 55; + goto f4; + ctr30: cs = 55; + goto f5; + ctr37: cs = 55; + goto f6; + ctr39: cs = 55; + goto f7; + ctr41: cs = 55; + goto f8; + ctr45: cs = 55; + goto f9; + ctr47: cs = 55; + goto f10; + ctr49: cs = 55; + goto f11; + ctr53: cs = 55; + goto f12; + ctr55: cs = 55; + goto f13; + ctr57: cs = 55; + goto f14; + ctr58: cs = 55; + goto f15; + ctr59: cs = 55; + goto f16; + ctr63: cs = 55; + goto f17; + ctr64: cs = 55; + goto f18; + ctr65: cs = 55; + goto f19; + ctr66: cs = 55; + goto f20; + ctr67: cs = 55; + goto f21; + ctr69: cs = 55; + goto f22; + ctr71: cs = 55; + goto f23; + ctr72: cs = 55; + goto f24; + ctr73: cs = 55; + goto f25; + ctr74: cs = 55; + goto f26; + ctr78: cs = 55; + goto f27; + ctr79: cs = 55; + goto f28; + ctr80: cs = 55; + goto f29; + ctr82: cs = 55; + goto f30; + ctr84: cs = 55; + goto f31; + ctr86: cs = 55; + goto f32; + ctr87: cs = 55; + goto f33; + + f0: _acts = _Parser_actions + 1 ; + goto execFuncs; + f31: _acts = _Parser_actions + 3 ; + goto execFuncs; + f33: _acts = _Parser_actions + 8 ; + goto execFuncs; + f25: _acts = _Parser_actions + 13 ; + goto execFuncs; + f21: _acts = _Parser_actions + 18 ; + goto execFuncs; + f15: _acts = _Parser_actions + 23 ; + goto execFuncs; + f16: _acts = _Parser_actions + 28 ; + goto execFuncs; + f2: _acts = _Parser_actions + 33 ; + goto execFuncs; + f3: _acts = _Parser_actions + 38 ; + goto execFuncs; + f1: _acts = _Parser_actions + 43 ; + goto execFuncs; + f32: _acts = _Parser_actions + 48 ; + goto execFuncs; + f20: _acts = _Parser_actions + 53 ; + goto execFuncs; + f18: _acts = _Parser_actions + 58 ; + goto execFuncs; + f19: _acts = _Parser_actions + 63 ; + goto execFuncs; + f17: _acts = _Parser_actions + 68 ; + goto execFuncs; + f26: _acts = _Parser_actions + 73 ; + goto execFuncs; + f4: _acts = _Parser_actions + 78 ; + goto execFuncs; + f22: _acts = _Parser_actions + 83 ; + goto execFuncs; + f23: _acts = _Parser_actions + 88 ; + goto execFuncs; + f5: _acts = _Parser_actions + 93 ; + goto execFuncs; + f6: _acts = _Parser_actions + 98 ; + goto execFuncs; + f9: _acts = _Parser_actions + 103 ; + goto execFuncs; + f12: _acts = _Parser_actions + 108 ; + goto execFuncs; + f28: _acts = _Parser_actions + 113 ; + goto execFuncs; + f29: _acts = _Parser_actions + 118 ; + goto execFuncs; + f27: _acts = _Parser_actions + 123 ; + goto execFuncs; + f24: _acts = _Parser_actions + 128 ; + goto execFuncs; + f30: _acts = _Parser_actions + 133 ; + goto execFuncs; + f8: _acts = _Parser_actions + 138 ; + goto execFuncs; + f7: _acts = _Parser_actions + 143 ; + goto execFuncs; + f11: _acts = _Parser_actions + 148 ; + goto execFuncs; + f10: _acts = _Parser_actions + 153 ; + goto execFuncs; + f14: _acts = _Parser_actions + 158 ; + goto execFuncs; + f13: _acts = _Parser_actions + 163 ; + goto execFuncs; + + execFuncs: + _nacts = ( unsigned int ) (*( _acts )) + ; + _acts += 1; + while ( _nacts > 0 ) + { + switch ( (*( _acts )) + ) { + case 0: + { + p->state = (_ps); + push( p ); + + } + + break; + case 1: + { + cs = (pop(1)); + } + + break; + case 2: + { + cs = (pop(2)); + } + + break; + case 3: + { + cs = (pop(3)); + } + + break; + case 4: + { + cs = (pop(4)); + } + + break; + case 5: + { + redLel = new Lel_start(); + redLel->type = 23; + + } + + break; + case 6: + { + redLel = new Lel_M(); + redLel->type = 24; + + } + + break; + case 7: + { + redLel = new LangEl(); + redLel->type = 25; + + } + + break; + case 8: + { + redLel = new LangEl(); + redLel->type = 26; + + } + + break; + case 9: + { + redLel = new LangEl(); + redLel->type = 27; + + } + + break; + case 10: + { + redLel = new LangEl(); + redLel->type = 28; + + } + + break; + case 11: + { + redLel = new LangEl(); + redLel->type = 29; + + } + + break; + case 12: + { + redLel = new LangEl(); + redLel->type = 30; + + } + + break; + case 13: + { + rem(p, 1); + } + + break; + case 14: + { + rem(p, 2); + } + + break; + case 15: + { + rem(p, 3); + } + + break; + case 16: + { + rem(p, 4); + } + + break; + case 17: + { + #line 41 "tmp.gmr" + + cout << "start = M;" << endl; + static_cast<Lel_start*>(redLel)->si = static_cast<Lel_M*>(rhs[0])->mi; + + #line 214 "tmp.rl" + + } + + break; + case 18: + { + #line 44 "tmp.gmr" + cout << "M = M A;" << endl; + #line 221 "tmp.rl" + + } + + break; + case 19: + { + #line 45 "tmp.gmr" + cout << "M = A;" << endl; + #line 228 "tmp.rl" + + } + + break; + case 20: + { + #line 46 "tmp.gmr" + cout << "A = tt_id tt_equals E tt_semi;" << endl; + #line 235 "tmp.rl" + + } + + break; + case 21: + { + #line 47 "tmp.gmr" + cout << "E = E tt_pipe T;" << endl; + #line 242 "tmp.rl" + + } + + break; + case 22: + { + #line 48 "tmp.gmr" + cout << "E = E tt_amp T;" << endl; + #line 249 "tmp.rl" + + } + + break; + case 23: + { + #line 49 "tmp.gmr" + cout << "E = E tt_minus T;" << endl; + #line 256 "tmp.rl" + + } + + break; + case 24: + { + #line 50 "tmp.gmr" + cout << "E = T;" << endl; + #line 263 "tmp.rl" + + } + + break; + case 25: + { + #line 51 "tmp.gmr" + cout << "T = T tt_dot N;" << endl; + #line 270 "tmp.rl" + + } + + break; + case 26: + { + #line 52 "tmp.gmr" + cout << "T = T N;" << endl; + #line 277 "tmp.rl" + + } + + break; + case 27: + { + #line 53 "tmp.gmr" + cout << "T = N;" << endl; + #line 284 "tmp.rl" + + } + + break; + case 28: + { + #line 54 "tmp.gmr" + cout << "N = N tt_colon tt_id;" << endl; + #line 291 "tmp.rl" + + } + + break; + case 29: + { + #line 55 "tmp.gmr" + cout << "N = N tt_percent tt_id;" << endl; + #line 298 "tmp.rl" + + } + + break; + case 30: + { + #line 56 "tmp.gmr" + cout << "N = N tt_dollar tt_id;" << endl; + #line 305 "tmp.rl" + + } + + break; + case 31: + { + #line 57 "tmp.gmr" + cout << "N = N tt_colon tt_plus tt_number;" << endl; + #line 312 "tmp.rl" + + } + + break; + case 32: + { + #line 58 "tmp.gmr" + cout << "N = N tt_colon tt_minus tt_number;" << endl; + #line 319 "tmp.rl" + + } + + break; + case 33: + { + #line 59 "tmp.gmr" + cout << "N = N tt_percent tt_plus tt_number;" << endl; + #line 326 "tmp.rl" + + } + + break; + case 34: + { + #line 60 "tmp.gmr" + cout << "N = N tt_percent tt_minus tt_number;" << endl; + #line 333 "tmp.rl" + + } + + break; + case 35: + { + #line 61 "tmp.gmr" + cout << "N = N tt_dollar tt_plus tt_number;" << endl; + #line 340 "tmp.rl" + + } + + break; + case 36: + { + #line 62 "tmp.gmr" + cout << "N = N tt_dollar tt_minus tt_number;" << endl; + #line 347 "tmp.rl" + + } + + break; + case 37: + { + #line 63 "tmp.gmr" + cout << "N = K;" << endl; + #line 354 "tmp.rl" + + } + + break; + case 38: + { + #line 64 "tmp.gmr" + cout << "K = F tt_star;" << endl; + #line 361 "tmp.rl" + + } + + break; + case 39: + { + #line 65 "tmp.gmr" + cout << "K = F tt_question;" << endl; + #line 368 "tmp.rl" + + } + + break; + case 40: + { + #line 66 "tmp.gmr" + cout << "K = F tt_plus;" << endl; + #line 375 "tmp.rl" + + } + + break; + case 41: + { + #line 67 "tmp.gmr" + cout << "K = F;" << endl; + #line 382 "tmp.rl" + + } + + break; + case 42: + { + #line 68 "tmp.gmr" + cout << "K = tt_not F tt_star;" << endl; + #line 389 "tmp.rl" + + } + + break; + case 43: + { + #line 69 "tmp.gmr" + cout << "K = tt_not F tt_question;" << endl; + #line 396 "tmp.rl" + + } + + break; + case 44: + { + #line 70 "tmp.gmr" + cout << "K = tt_not F tt_plus;" << endl; + #line 403 "tmp.rl" + + } + + break; + case 45: + { + #line 71 "tmp.gmr" + cout << "K = tt_not F;" << endl; + #line 410 "tmp.rl" + + } + + break; + case 46: + { + #line 72 "tmp.gmr" + cout << "F = tt_andFSM;" << endl; + #line 417 "tmp.rl" + + } + + break; + case 47: + { + #line 73 "tmp.gmr" + cout << "F = tt_orFSM;" << endl; + #line 424 "tmp.rl" + + } + + break; + case 48: + { + #line 74 "tmp.gmr" + cout << "F = tt_id;" << endl; + #line 431 "tmp.rl" + + } + + break; + case 49: + { + #line 75 "tmp.gmr" + cout << "F = tt_open E tt_close;" << endl; + #line 438 "tmp.rl" + + } + + break; + + } + _acts += 1; + _nacts -= 1; + } + + + goto _again; + + _again: + if ( cs == 0 ) + goto _out; + + p += 1; + if ( p != pe ) + goto _resume; + + _test_eof: {} + _out: {} + } + if ( cs == Parser_error ) + return -1; + if ( cs >= Parser_first_final ) + return 1; + return 0; +} + +int Parser::finish( ) +{ + if ( cs == Parser_error ) + return -1; + if ( cs >= Parser_first_final ) + return 1; + return 0; +} + +void Parser::parseLangEl( LangEl *lel ) +{ + redLel = 0; + execute( lel, 1 ); + while ( redLel != 0 ) { + execute( redLel, 1 ); + redLel = 0; + execute( lel, 1 ); + } +} + +int Parser::pop( int n ) +{ + for ( int i = n-1; i >= 0; i-- ) + rhs[i] = pop(); + return rhs[0]->state; +} + +void Parser::rem( LangEl *lel, int n ) +{ + for ( int i = n-1; i >= 0; i-- ) + delete rhs[i]; +} + +int Parser::done( ) +{ + Token *eof = new Token; + eof->type = l__eof; + eof->line = 0; + eof->pos = 0; + parseLangEl( eof ); + return finish(); +} + +#line 77 "tmp.gmr" + + +#include <assert.h> +#define MAX_TOKS 10000 + +struct TokList +{ + TokList() : numToks(0) { } + + void append( int type ); + int parse(); + + Token *toks[MAX_TOKS]; + int numToks; +}; + +void TokList::append( int type ) +{ + assert( numToks < MAX_TOKS ); + toks[numToks] = new Token; + toks[numToks]->type = type; + numToks += 1; +} + +int TokList::parse() +{ + Parser parser; + parser.init(); + for ( int i = 0; i < numToks; i++ ) + parser.parseLangEl( toks[i] ); + return parser.done(); +} + +void test0() +{ + TokList tokList; + tokList.append( tt_id ); + tokList.append( tt_equals ); + tokList.append( tt_id ); + tokList.append( tt_star ); + tokList.append( tt_minus ); + tokList.append( tt_andFSM ); + tokList.append( tt_dot ); + tokList.append( tt_id ); + tokList.append( tt_semi ); + tokList.append( tt_id ); + tokList.append( tt_equals ); + tokList.append( tt_id ); + tokList.append( tt_andFSM ); + tokList.append( tt_id ); + tokList.append( tt_semi ); + cout << tokList.parse() << endl; +} + +void test1() +{ + TokList tokList; + tokList.append( tt_id ); + tokList.append( tt_equals ); + tokList.append( tt_open ); + tokList.append( tt_orFSM ); + tokList.append( tt_minus ); + tokList.append( tt_andFSM ); + tokList.append( tt_close ); + tokList.append( tt_star ); + tokList.append( tt_semi ); + cout << tokList.parse() << endl; +} +void test2() +{ + TokList tokList; + tokList.append( tt_id ); + tokList.append( tt_equals ); + tokList.append( tt_not ); + tokList.append( tt_open ); + tokList.append( tt_orFSM ); + tokList.append( tt_minus ); + tokList.append( tt_not ); + tokList.append( tt_andFSM ); + tokList.append( tt_close ); + tokList.append( tt_star ); + tokList.append( tt_semi ); + cout << tokList.parse() << endl; +} +void test3() +{ + TokList tokList; + tokList.append( tt_id ); + tokList.append( tt_equals ); + tokList.append( tt_id ); + tokList.append( tt_colon ); + tokList.append( tt_minus ); + tokList.append( tt_number ); + tokList.append( tt_id ); + tokList.append( tt_colon ); + tokList.append( tt_id ); + tokList.append( tt_id ); + tokList.append( tt_dollar ); + tokList.append( tt_plus ); + tokList.append( tt_number ); + tokList.append( tt_id ); + tokList.append( tt_percent ); + tokList.append( tt_minus ); + tokList.append( tt_number ); + tokList.append( tt_semi ); + cout << tokList.parse() << endl; +} +void test4() +{ + TokList tokList; + tokList.append( tt_id ); + tokList.append( tt_equals ); + tokList.append( tt_id ); + tokList.append( tt_pipe ); + tokList.append( tt_id ); + tokList.append( tt_amp ); + tokList.append( tt_id ); + tokList.append( tt_minus ); + tokList.append( tt_id ); + tokList.append( tt_semi ); + cout << tokList.parse() << endl; +} + +int main() +{ + test0(); + test1(); + test2(); + test3(); + test4(); +} + |