diff options
Diffstat (limited to 'src/starter/parser/lexer.c')
-rw-r--r-- | src/starter/parser/lexer.c | 266 |
1 files changed, 122 insertions, 144 deletions
diff --git a/src/starter/parser/lexer.c b/src/starter/parser/lexer.c index cebf5a06c..a0937710e 100644 --- a/src/starter/parser/lexer.c +++ b/src/starter/parser/lexer.c @@ -456,8 +456,8 @@ static void yy_fatal_error (yyconst char msg[] ,yyscan_t yyscanner ); yyg->yy_c_buf_p = yy_cp; /* %% [4.0] data tables for the DFA and the user's section 1 definitions go here */ -#define YY_NUM_RULES 29 -#define YY_END_OF_BUFFER 30 +#define YY_NUM_RULES 26 +#define YY_END_OF_BUFFER 27 /* This struct is not used in this scanner, but its presence is necessary. */ struct yy_trans_info @@ -465,17 +465,16 @@ struct yy_trans_info flex_int32_t yy_verify; flex_int32_t yy_nxt; }; -static yyconst flex_int16_t yy_accept[83] = +static yyconst flex_int16_t yy_accept[80] = { 0, - 0, 0, 0, 0, 0, 0, 30, 12, 3, 5, + 0, 0, 0, 0, 0, 0, 27, 12, 3, 5, 11, 4, 6, 12, 12, 2, 12, 12, 17, 13, - 14, 15, 28, 19, 18, 20, 12, 3, 4, 4, - 0, 12, 2, 0, 9, 12, 12, 17, 16, 28, - 27, 26, 27, 24, 25, 21, 22, 23, 12, 0, - 12, 12, 12, 0, 12, 8, 12, 12, 0, 12, - 12, 12, 0, 12, 12, 12, 0, 0, 12, 0, - 0, 0, 12, 0, 1, 10, 10, 0, 0, 0, - 7, 0 + 14, 15, 25, 18, 19, 12, 3, 4, 4, 0, + 12, 2, 0, 9, 12, 12, 17, 16, 25, 24, + 23, 24, 20, 21, 22, 12, 0, 12, 12, 12, + 0, 12, 8, 12, 12, 0, 12, 12, 12, 0, + 12, 12, 12, 0, 0, 12, 0, 0, 0, 12, + 0, 1, 10, 10, 0, 0, 0, 7, 0 } ; static yyconst flex_int32_t yy_ec[256] = @@ -489,11 +488,11 @@ static yyconst flex_int32_t yy_ec[256] = 8, 1, 1, 9, 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, 10, 1, 1, 1, 1, 11, 12, 13, 14, + 1, 10, 1, 1, 1, 1, 11, 1, 12, 13, - 15, 16, 17, 1, 18, 1, 1, 19, 1, 20, - 21, 22, 1, 23, 24, 25, 26, 27, 1, 1, - 1, 1, 1, 1, 28, 1, 1, 1, 1, 1, + 14, 15, 16, 1, 17, 1, 1, 18, 1, 19, + 20, 21, 1, 22, 23, 24, 25, 26, 1, 1, + 1, 1, 1, 1, 27, 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, @@ -510,110 +509,106 @@ static yyconst flex_int32_t yy_ec[256] = 1, 1, 1, 1, 1 } ; -static yyconst flex_int32_t yy_meta[29] = +static yyconst flex_int32_t yy_meta[28] = { 0, 1, 2, 3, 1, 2, 4, 2, 5, 1, 6, 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 } ; -static yyconst flex_int16_t yy_base[94] = +static yyconst flex_int16_t yy_base[91] = { 0, - 0, 17, 43, 52, 7, 26, 102, 0, 9, 189, - 189, 0, 189, 93, 79, 36, 10, 83, 0, 189, - 189, 59, 0, 189, 189, 85, 0, 32, 0, 0, - 0, 83, 65, 80, 0, 74, 70, 0, 189, 0, - 189, 189, 88, 189, 189, 189, 189, 189, 71, 63, - 31, 61, 58, 59, 64, 0, 63, 66, 61, 61, - 56, 60, 53, 64, 41, 10, 40, 32, 109, 66, - 49, 27, 116, 37, 189, 189, 71, 8, 2, 5, - 189, 189, 124, 130, 136, 142, 148, 154, 159, 164, - 170, 176, 182 - + 0, 16, 41, 50, 4, 5, 101, 0, 24, 184, + 184, 0, 184, 92, 79, 32, 16, 83, 0, 184, + 184, 56, 0, 184, 81, 0, 33, 0, 0, 0, + 84, 62, 81, 0, 75, 71, 0, 184, 0, 184, + 184, 89, 184, 184, 184, 73, 68, 1, 66, 62, + 63, 65, 0, 64, 67, 62, 62, 57, 62, 55, + 67, 47, 63, 40, 31, 104, 68, 47, 35, 111, + 42, 184, 184, 69, 17, 7, 9, 184, 184, 119, + 125, 131, 137, 143, 149, 154, 159, 165, 171, 177 } ; -static yyconst flex_int16_t yy_def[94] = +static yyconst flex_int16_t yy_def[91] = { 0, - 83, 83, 84, 84, 85, 85, 82, 86, 82, 82, - 82, 87, 82, 86, 86, 82, 86, 86, 88, 82, - 82, 82, 89, 82, 82, 90, 86, 82, 87, 87, - 86, 86, 82, 82, 86, 86, 86, 88, 82, 89, - 82, 82, 82, 82, 82, 82, 82, 82, 86, 82, - 86, 86, 86, 82, 86, 86, 86, 86, 82, 86, - 86, 86, 82, 86, 86, 86, 82, 82, 91, 92, - 93, 82, 91, 93, 82, 82, 92, 82, 82, 82, - 82, 0, 82, 82, 82, 82, 82, 82, 82, 82, - 82, 82, 82 - + 80, 80, 81, 81, 82, 82, 79, 83, 79, 79, + 79, 84, 79, 83, 83, 79, 83, 83, 85, 79, + 79, 79, 86, 79, 87, 83, 79, 84, 84, 83, + 83, 79, 79, 83, 83, 83, 85, 79, 86, 79, + 79, 79, 79, 79, 79, 83, 79, 83, 83, 83, + 79, 83, 83, 83, 83, 79, 83, 83, 83, 79, + 83, 83, 83, 79, 79, 88, 89, 90, 79, 88, + 90, 79, 79, 89, 79, 79, 79, 79, 0, 79, + 79, 79, 79, 79, 79, 79, 79, 79, 79, 79 } ; -static yyconst flex_int16_t yy_nxt[218] = +static yyconst flex_int16_t yy_nxt[212] = { 0, - 82, 9, 10, 82, 9, 11, 12, 13, 14, 24, - 28, 70, 25, 28, 70, 29, 26, 15, 16, 10, - 35, 16, 11, 12, 13, 14, 81, 80, 24, 17, - 36, 25, 79, 28, 15, 26, 28, 33, 29, 75, - 33, 78, 29, 18, 20, 20, 55, 20, 21, 20, - 56, 75, 22, 20, 20, 72, 20, 21, 20, 71, - 69, 22, 34, 39, 39, 39, 33, 77, 68, 33, - 77, 29, 77, 67, 66, 77, 65, 64, 63, 62, - 61, 60, 59, 58, 57, 54, 39, 42, 43, 53, - 42, 34, 52, 51, 50, 49, 44, 37, 32, 31, - - 45, 82, 82, 82, 46, 82, 82, 47, 82, 48, - 74, 75, 82, 74, 74, 74, 74, 74, 75, 82, - 74, 74, 74, 74, 8, 8, 8, 8, 8, 8, - 19, 19, 19, 19, 19, 19, 23, 23, 23, 23, - 23, 23, 27, 82, 82, 82, 82, 27, 30, 30, - 82, 30, 30, 30, 38, 82, 82, 82, 38, 40, - 40, 82, 82, 40, 41, 41, 41, 41, 41, 41, - 73, 73, 73, 73, 73, 73, 76, 76, 76, 76, - 82, 76, 74, 74, 74, 74, 74, 74, 7, 82, - 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, - - 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, - 82, 82, 82, 82, 82, 82, 82 + 79, 9, 10, 79, 9, 11, 12, 13, 14, 24, + 24, 79, 79, 25, 25, 52, 15, 16, 10, 53, + 16, 11, 12, 13, 14, 27, 34, 17, 27, 78, + 28, 77, 15, 32, 27, 35, 32, 27, 28, 28, + 76, 18, 20, 20, 72, 20, 21, 20, 75, 72, + 22, 20, 20, 69, 20, 21, 20, 33, 68, 22, + 38, 38, 38, 32, 67, 66, 32, 67, 28, 74, + 74, 65, 74, 74, 64, 63, 62, 61, 60, 59, + 58, 57, 38, 41, 42, 56, 55, 33, 54, 51, + 50, 41, 49, 48, 47, 46, 36, 31, 30, 43, + + 79, 79, 44, 79, 45, 71, 72, 79, 71, 71, + 71, 71, 71, 72, 79, 71, 71, 71, 71, 8, + 8, 8, 8, 8, 8, 19, 19, 19, 19, 19, + 19, 23, 23, 23, 23, 23, 23, 26, 79, 79, + 79, 79, 26, 29, 29, 79, 29, 29, 29, 37, + 79, 79, 79, 37, 39, 39, 39, 79, 39, 40, + 40, 40, 40, 40, 40, 70, 70, 70, 70, 70, + 70, 73, 73, 73, 73, 79, 73, 71, 71, 71, + 71, 71, 71, 7, 79, 79, 79, 79, 79, 79, + 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, + + 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, + 79 } ; -static yyconst flex_int16_t yy_chk[218] = +static yyconst flex_int16_t yy_chk[212] = { 0, 0, 1, 1, 0, 1, 1, 1, 1, 1, 5, - 9, 66, 5, 9, 66, 9, 5, 1, 2, 2, - 17, 2, 2, 2, 2, 2, 80, 79, 6, 2, - 17, 6, 78, 28, 2, 6, 28, 16, 28, 74, - 16, 72, 16, 2, 3, 3, 51, 3, 3, 3, - 51, 71, 3, 4, 4, 68, 4, 4, 4, 67, - 65, 4, 16, 22, 22, 22, 33, 70, 64, 33, - 70, 33, 77, 63, 62, 77, 61, 60, 59, 58, - 57, 55, 54, 53, 52, 50, 22, 26, 26, 49, - 43, 33, 37, 36, 34, 32, 26, 18, 15, 14, - - 26, 7, 0, 0, 26, 0, 0, 26, 0, 26, - 69, 69, 0, 69, 69, 69, 69, 73, 73, 0, - 73, 73, 73, 73, 83, 83, 83, 83, 83, 83, - 84, 84, 84, 84, 84, 84, 85, 85, 85, 85, - 85, 85, 86, 0, 0, 0, 0, 86, 87, 87, - 0, 87, 87, 87, 88, 0, 0, 0, 88, 89, - 89, 0, 0, 89, 90, 90, 90, 90, 90, 90, - 91, 91, 91, 91, 91, 91, 92, 92, 92, 92, - 0, 92, 93, 93, 93, 93, 93, 93, 82, 82, - 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, - - 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, - 82, 82, 82, 82, 82, 82, 82 + 6, 0, 0, 5, 6, 48, 1, 2, 2, 48, + 2, 2, 2, 2, 2, 9, 17, 2, 9, 77, + 9, 76, 2, 16, 27, 17, 16, 27, 16, 27, + 75, 2, 3, 3, 71, 3, 3, 3, 69, 68, + 3, 4, 4, 65, 4, 4, 4, 16, 64, 4, + 22, 22, 22, 32, 63, 62, 32, 63, 32, 67, + 74, 61, 67, 74, 60, 59, 58, 57, 56, 55, + 54, 52, 22, 25, 25, 51, 50, 32, 49, 47, + 46, 42, 36, 35, 33, 31, 18, 15, 14, 25, + + 7, 0, 25, 0, 25, 66, 66, 0, 66, 66, + 66, 66, 70, 70, 0, 70, 70, 70, 70, 80, + 80, 80, 80, 80, 80, 81, 81, 81, 81, 81, + 81, 82, 82, 82, 82, 82, 82, 83, 0, 0, + 0, 0, 83, 84, 84, 0, 84, 84, 84, 85, + 0, 0, 0, 85, 86, 86, 86, 0, 86, 87, + 87, 87, 87, 87, 87, 88, 88, 88, 88, 88, + 88, 89, 89, 89, 89, 0, 89, 90, 90, 90, + 90, 90, 90, 79, 79, 79, 79, 79, 79, 79, + 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, + + 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, + 79 } ; /* Table of booleans, true if rule could match eol. */ -static yyconst flex_int32_t yy_rule_can_match_eol[30] = +static yyconst flex_int32_t yy_rule_can_match_eol[27] = { 0, -0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 1, - 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, }; +0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 1, 0, 1, 0, }; -static yyconst flex_int16_t yy_rule_linenum[29] = +static yyconst flex_int16_t yy_rule_linenum[26] = { 0, 60, 61, 62, 63, 65, 67, 68, 69, 70, 72, - 77, 82, 90, 109, 112, 115, 118, 124, 126, 127, - 150, 151, 152, 153, 154, 155, 156, 157 + 77, 82, 90, 109, 112, 115, 118, 124, 126, 145, + 146, 147, 148, 149, 150 } ; /* The intent behind this definition is that it'll catch @@ -662,7 +657,7 @@ static void include_files(parser_helper_t *ctx); /* state used to scan quoted strings */ -#line 666 "parser/lexer.c" +#line 661 "parser/lexer.c" #define INITIAL 0 #define inc 1 @@ -977,7 +972,7 @@ YY_DECL #line 58 "parser/lexer.l" -#line 981 "parser/lexer.c" +#line 976 "parser/lexer.c" yylval = yylval_param; @@ -1043,13 +1038,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 >= 83 ) + if ( yy_current_state >= 80 ) 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] != 189 ); + while ( yy_base[yy_current_state] != 184 ); yy_find_action: /* %% [10.0] code to find the action number goes here */ @@ -1084,13 +1079,13 @@ do_action: /* This label is used only to access EOF actions. */ { if ( yy_act == 0 ) fprintf( stderr, "--scanner backing up\n" ); - else if ( yy_act < 29 ) + else if ( yy_act < 26 ) fprintf( stderr, "--accepting rule at line %ld (\"%s\")\n", (long)yy_rule_linenum[yy_act], yytext ); - else if ( yy_act == 29 ) + else if ( yy_act == 26 ) fprintf( stderr, "--accepting default rule (\"%s\")\n", yytext ); - else if ( yy_act == 30 ) + else if ( yy_act == 27 ) fprintf( stderr, "--(end of buffer or a NUL)\n" ); else fprintf( stderr, "--EOF (start condition %d)\n", YY_START ); @@ -1246,21 +1241,13 @@ case 18: case YY_STATE_EOF(str): #line 125 "parser/lexer.l" case 19: -/* rule 19 can match eol */ -#line 127 "parser/lexer.l" -case 20: -/* rule 20 can match eol */ YY_RULE_SETUP -#line 127 "parser/lexer.l" +#line 126 "parser/lexer.l" { if (!streq(yytext, "\"")) { - if (streq(yytext, "\n")) - { /* put the newline back to fix the line numbers */ - unput('\n'); - yy_set_bol(0); - } PARSER_DBG1(yyextra, "unterminated string detected"); + return STRING_ERROR; } if (yy_top_state(yyscanner) == inc) { /* string include */ @@ -1276,52 +1263,43 @@ YY_RULE_SETUP } } YY_BREAK -case 21: +case 20: YY_RULE_SETUP -#line 150 "parser/lexer.l" +#line 145 "parser/lexer.l" yyextra->string_add(yyextra, "\n"); YY_BREAK -case 22: +case 21: YY_RULE_SETUP -#line 151 "parser/lexer.l" +#line 146 "parser/lexer.l" yyextra->string_add(yyextra, "\r"); YY_BREAK -case 23: +case 22: YY_RULE_SETUP -#line 152 "parser/lexer.l" +#line 147 "parser/lexer.l" yyextra->string_add(yyextra, "\t"); YY_BREAK -case 24: -YY_RULE_SETUP -#line 153 "parser/lexer.l" -yyextra->string_add(yyextra, "\b"); - YY_BREAK -case 25: -YY_RULE_SETUP -#line 154 "parser/lexer.l" -yyextra->string_add(yyextra, "\f"); - YY_BREAK -case 26: -/* rule 26 can match eol */ +case 23: +/* rule 23 can match eol */ YY_RULE_SETUP -#line 155 "parser/lexer.l" +#line 148 "parser/lexer.l" /* merge lines that end with EOL characters */ YY_BREAK -case 27: +case 24: YY_RULE_SETUP -#line 156 "parser/lexer.l" +#line 149 "parser/lexer.l" yyextra->string_add(yyextra, yytext+1); YY_BREAK -case 28: +case 25: +/* rule 25 can match eol */ YY_RULE_SETUP -#line 157 "parser/lexer.l" +#line 150 "parser/lexer.l" { yyextra->string_add(yyextra, yytext); } YY_BREAK case YY_STATE_EOF(INITIAL): -#line 162 "parser/lexer.l" +#line 155 "parser/lexer.l" { conf_parser_pop_buffer_state(yyscanner); if (!conf_parser_open_next_file(yyextra) && !YY_CURRENT_BUFFER) @@ -1330,12 +1308,12 @@ case YY_STATE_EOF(INITIAL): } } YY_BREAK -case 29: +case 26: YY_RULE_SETUP -#line 170 "parser/lexer.l" +#line 163 "parser/lexer.l" YY_FATAL_ERROR( "flex scanner jammed" ); YY_BREAK -#line 1339 "parser/lexer.c" +#line 1317 "parser/lexer.c" case YY_END_OF_BUFFER: { @@ -1649,7 +1627,7 @@ static int yy_get_next_buffer (yyscan_t yyscanner) 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 >= 83 ) + if ( yy_current_state >= 80 ) yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; @@ -1683,11 +1661,11 @@ static int yy_get_next_buffer (yyscan_t yyscanner) 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 >= 83 ) + if ( yy_current_state >= 80 ) 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 == 82); + yy_is_jam = (yy_current_state == 79); return yy_is_jam ? 0 : yy_current_state; } @@ -2705,7 +2683,7 @@ void conf_parser_free (void * ptr , yyscan_t yyscanner) /* %ok-for-header */ -#line 170 "parser/lexer.l" +#line 163 "parser/lexer.l" |