From d911517dc2f9c4c3ce57529ac4d64c17185544e9 Mon Sep 17 00:00:00 2001 From: Guido Günther Date: Mon, 25 May 2009 18:39:27 +0200 Subject: Imported Upstream version 0.10 --- etpo/lexer.c | 191 ++++++++++++++++++++++++++++++++++++++++------------------- 1 file changed, 130 insertions(+), 61 deletions(-) (limited to 'etpo/lexer.c') diff --git a/etpo/lexer.c b/etpo/lexer.c index 9f4530a..e5d536a 100644 --- a/etpo/lexer.c +++ b/etpo/lexer.c @@ -368,8 +368,8 @@ static void yy_fatal_error (yyconst char msg[] ); *yy_cp = '\0'; \ (yy_c_buf_p) = yy_cp; -#define YY_NUM_RULES 14 -#define YY_END_OF_BUFFER 15 +#define YY_NUM_RULES 16 +#define YY_END_OF_BUFFER 17 /* This struct is not used in this scanner, but its presence is necessary. */ struct yy_trans_info @@ -377,13 +377,21 @@ struct yy_trans_info flex_int32_t yy_verify; flex_int32_t yy_nxt; }; -static yyconst flex_int16_t yy_accept[43] = +static yyconst flex_int16_t yy_accept[121] = { 0, - 0, 0, 0, 0, 15, 14, 8, 6, 9, 4, - 7, 14, 7, 14, 11, 11, 10, 11, 7, 5, - 3, 7, 7, 1, 0, 13, 11, 11, 11, 2, - 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, - 7, 0 + 0, 0, 0, 0, 17, 16, 8, 6, 9, 4, + 7, 16, 7, 16, 7, 7, 7, 11, 11, 10, + 11, 11, 11, 11, 7, 5, 3, 7, 7, 1, + 0, 13, 7, 7, 7, 7, 11, 11, 11, 11, + 11, 11, 11, 2, 7, 7, 0, 7, 7, 11, + 11, 11, 11, 7, 7, 0, 0, 15, 7, 7, + 11, 11, 11, 11, 11, 11, 7, 7, 7, 7, + 11, 11, 11, 7, 7, 0, 11, 11, 7, 7, + 7, 0, 11, 11, 7, 7, 7, 14, 11, 11, + 7, 7, 7, 11, 7, 7, 11, 1, 11, 7, + + 11, 7, 7, 11, 11, 7, 7, 11, 11, 7, + 7, 11, 11, 7, 11, 7, 11, 7, 11, 0 } ; static yyconst flex_int32_t yy_ec[256] = @@ -392,15 +400,15 @@ static yyconst flex_int32_t yy_ec[256] = 1, 1, 4, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 5, 6, 1, 1, 1, 1, 1, - 1, 1, 1, 7, 8, 1, 1, 8, 8, 8, - 8, 8, 8, 8, 8, 8, 8, 1, 1, 1, + 1, 1, 1, 7, 8, 1, 1, 9, 9, 9, + 9, 9, 9, 9, 9, 9, 9, 1, 1, 1, 1, 1, 1, 1, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, - 1, 9, 1, 1, 10, 1, 11, 12, 13, 14, + 1, 10, 1, 1, 11, 1, 12, 13, 14, 15, - 15, 8, 8, 8, 8, 8, 8, 16, 8, 17, - 18, 8, 8, 19, 8, 20, 8, 8, 8, 8, + 16, 17, 18, 8, 19, 8, 8, 20, 21, 22, + 23, 24, 8, 25, 26, 27, 8, 8, 8, 28, 8, 8, 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, @@ -418,54 +426,99 @@ static yyconst flex_int32_t yy_ec[256] = 1, 1, 1, 1, 1 } ; -static yyconst flex_int32_t yy_meta[21] = +static yyconst flex_int32_t yy_meta[29] = { 0, - 1, 1, 1, 1, 2, 1, 1, 3, 1, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3 + 1, 1, 1, 1, 2, 1, 1, 3, 3, 1, + 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, + 3, 3, 3, 3, 3, 3, 3, 3 } ; -static yyconst flex_int16_t yy_base[48] = +static yyconst flex_int16_t yy_base[129] = { 0, - 0, 58, 18, 19, 63, 65, 65, 65, 65, 65, - 0, 59, 13, 58, 0, 0, 65, 24, 0, 65, - 0, 46, 40, 0, 55, 65, 0, 31, 0, 0, - 39, 37, 45, 15, 36, 42, 38, 39, 35, 33, - 29, 65, 36, 28, 39, 42, 45 + 0, 16, 6, 38, 165, 166, 166, 166, 166, 166, + 0, 161, 11, 160, 137, 9, 136, 0, 0, 166, + 9, 135, 12, 134, 0, 166, 0, 143, 132, 0, + 153, 166, 130, 152, 138, 136, 0, 10, 0, 126, + 148, 134, 132, 0, 124, 123, 26, 129, 127, 120, + 43, 126, 124, 115, 114, 135, 47, 166, 109, 117, + 110, 34, 50, 0, 106, 114, 121, 120, 128, 101, + 117, 125, 98, 33, 37, 54, 98, 56, 101, 111, + 110, 58, 109, 63, 105, 106, 105, 166, 104, 0, + 100, 95, 94, 93, 96, 95, 94, 98, 97, 55, + + 56, 95, 94, 93, 92, 77, 80, 75, 78, 83, + 76, 59, 62, 55, 53, 54, 43, 17, 5, 166, + 77, 80, 5, 83, 86, 89, 92, 95 } ; -static yyconst flex_int16_t yy_def[48] = +static yyconst flex_int16_t yy_def[129] = { 0, - 42, 1, 43, 43, 42, 42, 42, 42, 42, 42, - 44, 42, 44, 45, 46, 46, 42, 47, 44, 42, - 44, 44, 44, 44, 45, 42, 46, 47, 46, 44, - 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, - 44, 0, 42, 42, 42, 42, 42 + 121, 121, 122, 122, 120, 120, 120, 120, 120, 120, + 123, 120, 123, 124, 13, 123, 123, 125, 125, 120, + 126, 125, 125, 125, 123, 120, 123, 123, 123, 123, + 124, 120, 123, 123, 123, 123, 125, 126, 125, 125, + 125, 125, 125, 123, 123, 123, 127, 123, 123, 125, + 128, 125, 125, 123, 123, 127, 127, 120, 123, 123, + 125, 128, 128, 125, 125, 125, 123, 123, 123, 123, + 125, 125, 125, 123, 123, 120, 125, 125, 123, 123, + 123, 120, 125, 125, 123, 123, 123, 120, 125, 125, + 123, 123, 123, 125, 123, 123, 125, 123, 125, 123, + + 125, 123, 123, 125, 125, 123, 123, 125, 125, 123, + 123, 125, 125, 123, 125, 123, 125, 123, 125, 0, + 120, 120, 120, 120, 120, 120, 120, 120 } ; -static yyconst flex_int16_t yy_nxt[86] = +static yyconst flex_int16_t yy_nxt[195] = { 0, - 6, 7, 8, 8, 9, 6, 10, 11, 12, 11, - 11, 11, 11, 11, 13, 11, 11, 11, 11, 11, - 16, 16, 17, 17, 18, 21, 29, 35, 25, 22, - 19, 23, 24, 29, 36, 25, 15, 15, 15, 25, - 25, 25, 27, 24, 27, 28, 28, 28, 41, 21, - 40, 39, 38, 37, 34, 33, 32, 26, 31, 30, - 26, 20, 42, 14, 5, 42, 42, 42, 42, 42, - 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, - 42, 42, 42, 42, 42 + 6, 7, 8, 8, 9, 6, 10, 25, 19, 12, + 20, 39, 39, 31, 31, 13, 6, 7, 8, 8, + 9, 14, 10, 34, 27, 12, 41, 57, 58, 41, + 35, 15, 28, 42, 16, 29, 64, 30, 56, 17, + 19, 34, 20, 21, 63, 64, 79, 56, 57, 58, + 79, 63, 64, 22, 56, 76, 23, 78, 119, 80, + 88, 24, 82, 81, 84, 90, 82, 102, 104, 118, + 117, 84, 116, 115, 72, 103, 105, 11, 11, 11, + 18, 18, 18, 31, 31, 31, 37, 114, 37, 38, + 38, 38, 56, 56, 56, 62, 62, 62, 69, 113, + + 112, 111, 110, 109, 108, 107, 106, 101, 100, 99, + 98, 30, 97, 96, 95, 27, 94, 93, 92, 91, + 89, 87, 86, 85, 83, 41, 78, 77, 34, 76, + 75, 74, 73, 72, 71, 70, 69, 58, 68, 67, + 66, 65, 61, 60, 59, 55, 54, 53, 52, 51, + 50, 49, 48, 47, 46, 32, 45, 44, 43, 40, + 36, 33, 32, 26, 120, 5, 120, 120, 120, 120, + 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, + 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, + 120, 120, 120, 120 + } ; -static yyconst flex_int16_t yy_chk[86] = +static yyconst flex_int16_t yy_chk[195] = { 0, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 3, 4, 3, 4, 4, 13, 18, 34, 18, 13, - 44, 13, 13, 28, 34, 28, 43, 43, 43, 45, - 45, 45, 46, 41, 46, 47, 47, 47, 40, 39, - 38, 37, 36, 35, 33, 32, 31, 25, 23, 22, - 14, 12, 5, 2, 42, 42, 42, 42, 42, 42, - 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, - 42, 42, 42, 42, 42 + 1, 1, 1, 1, 1, 1, 1, 123, 3, 1, + 3, 21, 38, 21, 38, 1, 2, 2, 2, 2, + 2, 2, 2, 16, 13, 2, 23, 47, 47, 119, + 16, 2, 13, 23, 2, 13, 62, 13, 62, 2, + 4, 118, 4, 4, 51, 51, 74, 51, 57, 57, + 75, 63, 63, 4, 63, 76, 4, 78, 117, 74, + 82, 4, 76, 75, 78, 84, 82, 100, 101, 116, + 115, 84, 114, 113, 112, 100, 101, 121, 121, 121, + 122, 122, 122, 124, 124, 124, 125, 111, 125, 126, + 126, 126, 127, 127, 127, 128, 128, 128, 110, 109, + + 108, 107, 106, 105, 104, 103, 102, 99, 98, 97, + 96, 95, 94, 93, 92, 91, 89, 87, 86, 85, + 83, 81, 80, 79, 77, 73, 72, 71, 70, 69, + 68, 67, 66, 65, 61, 60, 59, 56, 55, 54, + 53, 52, 50, 49, 48, 46, 45, 43, 42, 41, + 40, 36, 35, 34, 33, 31, 29, 28, 24, 22, + 17, 15, 14, 12, 5, 120, 120, 120, 120, 120, + 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, + 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, + 120, 120, 120, 120 + } ; static yy_state_type yy_last_accepting_state; @@ -515,7 +568,7 @@ char *yytext; #include #include "grammar.h" -#line 519 "lexer.c" +#line 572 "lexer.c" #define INITIAL 0 #define QUOTED 1 @@ -708,7 +761,7 @@ YY_DECL #line 34 "lexer.l" -#line 712 "lexer.c" +#line 765 "lexer.c" if ( !(yy_init) ) { @@ -762,13 +815,13 @@ yy_match: while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 43 ) + if ( yy_current_state >= 121 ) yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; ++yy_cp; } - while ( yy_base[yy_current_state] != 65 ); + while ( yy_base[yy_current_state] != 166 ); yy_find_action: yy_act = yy_accept[yy_current_state]; @@ -873,11 +926,27 @@ YY_RULE_SETUP { }; YY_BREAK case 14: +*yy_cp = (yy_hold_char); /* undo effects of setting up yytext */ +(yy_c_buf_p) = yy_cp -= 1; +YY_DO_BEFORE_ACTION; /* set up yytext again */ YY_RULE_SETUP #line 56 "lexer.l" +{ }; + YY_BREAK +case 15: +*yy_cp = (yy_hold_char); /* undo effects of setting up yytext */ +(yy_c_buf_p) = yy_cp -= 1; +YY_DO_BEFORE_ACTION; /* set up yytext again */ +YY_RULE_SETUP +#line 57 "lexer.l" +{ }; + YY_BREAK +case 16: +YY_RULE_SETUP +#line 58 "lexer.l" ECHO; YY_BREAK -#line 881 "lexer.c" +#line 950 "lexer.c" case YY_STATE_EOF(INITIAL): case YY_STATE_EOF(QUOTED): yyterminate(); @@ -1171,7 +1240,7 @@ static int yy_get_next_buffer (void) while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 43 ) + if ( yy_current_state >= 121 ) yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; @@ -1199,11 +1268,11 @@ static int yy_get_next_buffer (void) while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 43 ) + if ( yy_current_state >= 121 ) yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; - yy_is_jam = (yy_current_state == 42); + yy_is_jam = (yy_current_state == 120); return yy_is_jam ? 0 : yy_current_state; } @@ -1879,7 +1948,7 @@ void yyfree (void * ptr ) #define YYTABLES_NAME "yytables" -#line 56 "lexer.l" +#line 58 "lexer.l" @@ -1930,15 +1999,15 @@ yywrap(void) static void header(void) { - const char *boilerplate = "const char *dummy = {\n"; - printf(boilerplate); + const char *boilerplate = "#include \n\nconst char *dummy[] = {\n"; + printf("%s", boilerplate); } static void tail(void) { - const char *boilerplate = "};\n"; - printf(boilerplate); + const char *boilerplate = "\tNULL\n};\n"; + printf("%s", boilerplate); } int -- cgit