diff options
author | Haru <haru@dotalux.com> | 2015-10-10 21:37:48 +0200 |
---|---|---|
committer | Haru <haru@dotalux.com> | 2015-10-11 05:14:59 +0200 |
commit | 34bdc27cabdc2c37e9b486013bf5ab42e8995e88 (patch) | |
tree | 5408c9abe51397df3277e4eccfb5cfce6b7f7420 /3rdparty/libconfig/scanner.c | |
parent | 2d51cded8d5612b7ecbe171a6ca309e91d14bfd7 (diff) | |
download | hercules-34bdc27cabdc2c37e9b486013bf5ab42e8995e88.tar.gz hercules-34bdc27cabdc2c37e9b486013bf5ab42e8995e88.tar.bz2 hercules-34bdc27cabdc2c37e9b486013bf5ab42e8995e88.tar.xz hercules-34bdc27cabdc2c37e9b486013bf5ab42e8995e88.zip |
Added support to libconfig for key names containing '.' or beginnig with digits.
- Note: Since '.' (period) is a valid character for key names, it is no
longer a valid path separator for lookups. Please use '/' (forward
slash) or ':' (semicolon) instead.
Signed-off-by: Haru <haru@dotalux.com>
Diffstat (limited to '3rdparty/libconfig/scanner.c')
-rw-r--r-- | 3rdparty/libconfig/scanner.c | 248 |
1 files changed, 134 insertions, 114 deletions
diff --git a/3rdparty/libconfig/scanner.c b/3rdparty/libconfig/scanner.c index 44a7d69dd..96c01fc5f 100644 --- a/3rdparty/libconfig/scanner.c +++ b/3rdparty/libconfig/scanner.c @@ -13,7 +13,7 @@ #define FLEX_SCANNER #define YY_FLEX_MAJOR_VERSION 2 #define YY_FLEX_MINOR_VERSION 5 -#define YY_FLEX_SUBMINOR_VERSION 37 +#define YY_FLEX_SUBMINOR_VERSION 39 #if YY_FLEX_SUBMINOR_VERSION > 0 #define FLEX_BETA #endif @@ -198,6 +198,13 @@ typedef size_t yy_size_t; if ( yytext[yyl] == '\n' )\ --yylineno;\ }while(0) + #define YY_LINENO_REWIND_TO(dst) \ + do {\ + const char *p;\ + for ( p = yy_cp-1; p >= (dst); --p)\ + if ( *p == '\n' )\ + --yylineno;\ + }while(0) /* Return all but the first "n" matched characters back to the input stream. */ #define yyless(n) \ @@ -374,21 +381,22 @@ struct yy_trans_info flex_int32_t yy_verify; flex_int32_t yy_nxt; }; -static yyconst flex_int16_t yy_accept[112] = +static yyconst flex_int16_t yy_accept[123] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 46, 44, 25, 24, 24, 5, 44, 40, 41, 32, - 44, 27, 33, 44, 34, 34, 26, 42, 44, 32, - 32, 38, 39, 28, 29, 25, 44, 3, 4, 3, + 46, 44, 25, 24, 24, 5, 44, 40, 41, 37, + 44, 27, 32, 44, 33, 33, 26, 42, 44, 37, + 37, 38, 39, 28, 29, 25, 44, 3, 4, 3, 6, 15, 14, 20, 23, 45, 17, 45, 25, 0, - 43, 32, 33, 34, 33, 0, 1, 0, 33, 0, - 35, 0, 16, 32, 32, 25, 0, 0, 2, 6, - 12, 0, 11, 10, 7, 8, 9, 20, 22, 21, - 17, 0, 18, 0, 33, 33, 0, 0, 33, 35, - 36, 32, 32, 0, 0, 0, 33, 37, 32, 30, - - 0, 13, 37, 31, 0, 0, 0, 0, 0, 19, - 0 + 43, 37, 32, 33, 32, 0, 1, 0, 32, 33, + 37, 34, 37, 16, 37, 37, 25, 0, 0, 2, + 6, 12, 0, 11, 10, 7, 8, 9, 20, 22, + 21, 17, 0, 18, 32, 0, 34, 0, 32, 32, + 37, 0, 37, 32, 34, 35, 37, 37, 0, 0, + + 32, 0, 32, 34, 0, 37, 32, 36, 37, 30, + 0, 13, 32, 36, 31, 0, 0, 0, 0, 0, + 19, 0 } ; static yyconst flex_int32_t yy_ec[256] = @@ -426,49 +434,51 @@ static yyconst flex_int32_t yy_ec[256] = static yyconst flex_int32_t yy_meta[51] = { 0, 1, 1, 1, 1, 1, 2, 1, 3, 1, 1, - 3, 1, 1, 3, 1, 1, 4, 4, 1, 1, + 3, 1, 1, 3, 3, 1, 4, 4, 1, 1, 1, 1, 1, 1, 4, 4, 4, 4, 3, 3, 3, 3, 3, 3, 3, 1, 2, 1, 4, 4, 4, 4, 3, 3, 3, 3, 3, 3, 1, 1 } ; -static yyconst flex_int16_t yy_base[124] = +static yyconst flex_int16_t yy_base[134] = { 0, - 0, 49, 49, 50, 48, 49, 50, 51, 214, 213, - 218, 221, 215, 221, 221, 221, 213, 221, 221, 0, - 47, 221, 41, 55, 62, 66, 221, 221, 209, 189, - 32, 221, 221, 221, 221, 67, 170, 221, 221, 196, - 0, 221, 64, 0, 221, 61, 205, 187, 207, 205, - 221, 0, 77, 97, 99, 111, 221, 204, 103, 119, - 170, 0, 221, 46, 71, 98, 153, 126, 221, 0, - 221, 0, 221, 221, 221, 221, 221, 0, 221, 221, - 164, 146, 221, 57, 117, 124, 131, 129, 135, 221, - 138, 135, 123, 127, 0, 137, 139, 132, 131, 0, - - 117, 221, 221, 0, 112, 99, 91, 111, 157, 221, - 221, 172, 176, 180, 184, 188, 190, 194, 198, 202, - 104, 98, 68 + 0, 49, 49, 50, 48, 49, 50, 51, 244, 243, + 248, 251, 245, 251, 251, 251, 243, 251, 251, 0, + 47, 251, 41, 55, 62, 210, 251, 251, 238, 218, + 32, 251, 251, 251, 251, 67, 199, 251, 251, 225, + 0, 251, 64, 0, 251, 61, 234, 216, 236, 234, + 251, 0, 66, 87, 95, 106, 251, 233, 98, 200, + 115, 204, 123, 251, 46, 47, 70, 190, 187, 251, + 0, 251, 0, 251, 251, 251, 251, 251, 0, 251, + 251, 219, 198, 251, 117, 142, 166, 57, 113, 120, + 154, 125, 128, 135, 0, 165, 162, 128, 154, 0, + + 156, 163, 161, 251, 167, 169, 171, 152, 149, 0, + 126, 251, 174, 0, 0, 119, 117, 85, 119, 94, + 251, 251, 197, 201, 205, 209, 213, 215, 219, 223, + 227, 115, 104 } ; -static yyconst flex_int16_t yy_def[124] = +static yyconst flex_int16_t yy_def[134] = { 0, - 111, 1, 112, 112, 113, 113, 114, 114, 115, 115, - 111, 111, 111, 111, 111, 111, 116, 111, 111, 117, - 111, 111, 111, 111, 111, 111, 111, 111, 111, 117, - 117, 111, 111, 111, 111, 111, 111, 111, 111, 111, - 118, 111, 111, 119, 111, 111, 120, 120, 111, 116, - 111, 117, 111, 111, 111, 111, 111, 116, 111, 111, - 111, 121, 111, 117, 117, 111, 111, 111, 111, 118, - 111, 122, 111, 111, 111, 111, 111, 119, 111, 111, - 120, 120, 111, 111, 111, 111, 111, 111, 111, 111, - 121, 117, 117, 111, 123, 111, 111, 111, 117, 117, - - 111, 111, 111, 117, 111, 111, 111, 111, 111, 111, - 0, 111, 111, 111, 111, 111, 111, 111, 111, 111, - 111, 111, 111 + 122, 1, 123, 123, 124, 124, 125, 125, 126, 126, + 122, 122, 122, 122, 122, 122, 127, 122, 122, 128, + 122, 122, 122, 122, 128, 25, 122, 122, 122, 128, + 128, 122, 122, 122, 122, 122, 122, 122, 122, 122, + 129, 122, 122, 130, 122, 122, 131, 131, 122, 127, + 122, 128, 122, 122, 122, 122, 122, 127, 128, 25, + 128, 128, 128, 122, 128, 128, 122, 122, 122, 122, + 129, 122, 132, 122, 122, 122, 122, 122, 130, 122, + 122, 131, 131, 122, 122, 122, 122, 122, 122, 128, + 128, 122, 128, 128, 128, 63, 128, 128, 122, 133, + + 122, 122, 122, 122, 122, 128, 128, 128, 128, 128, + 122, 122, 122, 128, 128, 122, 122, 122, 122, 122, + 122, 0, 122, 122, 122, 122, 122, 122, 122, 122, + 122, 122, 122 } ; -static yyconst flex_int16_t yy_nxt[272] = +static yyconst flex_int16_t yy_nxt[302] = { 0, 12, 13, 14, 15, 15, 16, 17, 12, 18, 19, 20, 21, 22, 21, 23, 24, 25, 26, 27, 28, @@ -476,33 +486,37 @@ static yyconst flex_int16_t yy_nxt[272] = 20, 20, 31, 20, 20, 32, 12, 33, 20, 20, 20, 30, 20, 20, 20, 20, 31, 20, 34, 35, 36, 39, 39, 42, 42, 45, 45, 55, 55, 40, - 40, 53, 65, 54, 54, 57, 79, 56, 66, 71, - 58, 102, 37, 85, 85, 92, 59, 65, 54, 54, - 59, 56, 54, 54, 43, 43, 46, 46, 60, 92, - 67, 61, 60, 55, 55, 61, 62, 80, 72, 66, - - 73, 95, 60, 56, 93, 74, 60, 91, 75, 76, - 77, 59, 109, 54, 54, 55, 55, 56, 93, 86, - 86, 67, 84, 60, 84, 56, 61, 85, 85, 87, - 88, 108, 88, 85, 85, 89, 89, 60, 107, 56, - 86, 86, 96, 87, 96, 89, 89, 97, 97, 100, - 87, 89, 89, 97, 97, 97, 97, 104, 109, 106, - 105, 103, 110, 100, 87, 101, 99, 98, 111, 82, - 94, 104, 38, 38, 38, 38, 41, 41, 41, 41, - 44, 44, 44, 44, 47, 47, 47, 47, 50, 50, - 50, 50, 52, 52, 70, 68, 70, 70, 78, 90, - - 78, 78, 81, 81, 81, 81, 51, 51, 49, 83, - 82, 69, 68, 64, 63, 51, 49, 111, 48, 48, - 11, 111, 111, 111, 111, 111, 111, 111, 111, 111, - 111, 111, 111, 111, 111, 111, 111, 111, 111, 111, - 111, 111, 111, 111, 111, 111, 111, 111, 111, 111, - 111, 111, 111, 111, 111, 111, 111, 111, 111, 111, - 111, 111, 111, 111, 111, 111, 111, 111, 111, 111, - 111 + 40, 53, 66, 54, 54, 57, 80, 56, 67, 72, + 58, 67, 37, 89, 89, 97, 59, 66, 60, 60, + 98, 56, 55, 55, 43, 43, 46, 46, 61, 97, + 68, 62, 56, 68, 98, 120, 63, 81, 73, 121, + + 74, 85, 61, 54, 54, 75, 56, 112, 76, 77, + 78, 55, 55, 86, 90, 90, 87, 88, 100, 88, + 120, 56, 89, 89, 91, 119, 92, 86, 93, 89, + 89, 94, 94, 101, 101, 56, 90, 90, 91, 96, + 96, 103, 103, 102, 94, 94, 91, 96, 96, 96, + 96, 94, 94, 92, 110, 92, 118, 102, 103, 103, + 91, 96, 96, 96, 96, 105, 117, 106, 110, 116, + 107, 107, 101, 101, 105, 115, 105, 103, 103, 113, + 113, 114, 102, 113, 113, 107, 107, 107, 107, 115, + 113, 113, 111, 109, 108, 104, 102, 38, 38, 38, + + 38, 41, 41, 41, 41, 44, 44, 44, 44, 47, + 47, 47, 47, 50, 50, 50, 50, 52, 52, 71, + 122, 71, 71, 79, 83, 79, 79, 82, 82, 82, + 82, 99, 69, 95, 52, 51, 51, 49, 84, 83, + 70, 69, 65, 64, 52, 51, 49, 122, 48, 48, + 11, 122, 122, 122, 122, 122, 122, 122, 122, 122, + 122, 122, 122, 122, 122, 122, 122, 122, 122, 122, + 122, 122, 122, 122, 122, 122, 122, 122, 122, 122, + 122, 122, 122, 122, 122, 122, 122, 122, 122, 122, + 122, 122, 122, 122, 122, 122, 122, 122, 122, 122, + + 122 } ; -static yyconst flex_int16_t yy_chk[272] = +static yyconst flex_int16_t yy_chk[302] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, @@ -511,29 +525,33 @@ static yyconst flex_int16_t yy_chk[272] = 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, 4, 5, 6, 7, 8, 23, 23, 3, 4, 21, 31, 21, 21, 24, 46, 23, 36, 43, - 24, 123, 2, 84, 84, 64, 25, 31, 25, 25, - 26, 23, 26, 26, 5, 6, 7, 8, 25, 64, - 36, 25, 26, 53, 53, 26, 25, 46, 43, 66, - - 43, 122, 25, 53, 65, 43, 26, 121, 43, 43, - 43, 54, 108, 54, 54, 55, 55, 53, 65, 59, - 59, 66, 56, 54, 56, 55, 54, 56, 56, 59, - 60, 107, 60, 85, 85, 60, 60, 54, 106, 55, - 86, 86, 87, 59, 87, 88, 88, 87, 87, 93, - 86, 89, 89, 96, 96, 97, 97, 99, 109, 105, - 101, 98, 109, 93, 86, 94, 92, 91, 82, 81, - 68, 99, 112, 112, 112, 112, 113, 113, 113, 113, - 114, 114, 114, 114, 115, 115, 115, 115, 116, 116, - 116, 116, 117, 117, 118, 67, 118, 118, 119, 61, - - 119, 119, 120, 120, 120, 120, 58, 50, 49, 48, - 47, 40, 37, 30, 29, 17, 13, 11, 10, 9, - 111, 111, 111, 111, 111, 111, 111, 111, 111, 111, - 111, 111, 111, 111, 111, 111, 111, 111, 111, 111, - 111, 111, 111, 111, 111, 111, 111, 111, 111, 111, - 111, 111, 111, 111, 111, 111, 111, 111, 111, 111, - 111, 111, 111, 111, 111, 111, 111, 111, 111, 111, - 111 + 24, 67, 2, 88, 88, 65, 25, 31, 25, 25, + 66, 23, 53, 53, 5, 6, 7, 8, 25, 65, + 36, 25, 53, 67, 66, 120, 25, 46, 43, 120, + + 43, 54, 25, 54, 54, 43, 53, 133, 43, 43, + 43, 55, 55, 54, 59, 59, 54, 56, 132, 56, + 119, 55, 56, 56, 59, 118, 61, 54, 61, 89, + 89, 61, 61, 85, 85, 55, 90, 90, 59, 63, + 63, 92, 92, 85, 93, 93, 90, 63, 63, 63, + 63, 94, 94, 86, 98, 86, 117, 85, 86, 86, + 90, 63, 63, 63, 63, 91, 116, 91, 98, 111, + 91, 91, 101, 101, 102, 109, 102, 103, 103, 102, + 102, 108, 101, 105, 105, 106, 106, 107, 107, 109, + 113, 113, 99, 97, 96, 87, 101, 123, 123, 123, + + 123, 124, 124, 124, 124, 125, 125, 125, 125, 126, + 126, 126, 126, 127, 127, 127, 127, 128, 128, 129, + 83, 129, 129, 130, 82, 130, 130, 131, 131, 131, + 131, 69, 68, 62, 60, 58, 50, 49, 48, 47, + 40, 37, 30, 29, 26, 17, 13, 11, 10, 9, + 122, 122, 122, 122, 122, 122, 122, 122, 122, 122, + 122, 122, 122, 122, 122, 122, 122, 122, 122, 122, + 122, 122, 122, 122, 122, 122, 122, 122, 122, 122, + 122, 122, 122, 122, 122, 122, 122, 122, 122, 122, + 122, 122, 122, 122, 122, 122, 122, 122, 122, 122, + + 122 } ; /* Table of booleans, true if rule could match eol. */ @@ -633,7 +651,7 @@ static int fromihex(const char *s) { } -#line 637 "scanner.c" +#line 655 "scanner.c" #define INITIAL 0 #define COMMENT 1 @@ -865,11 +883,6 @@ YY_DECL register int yy_act; struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; -#line 112 "scanner.l" - - -#line 872 "scanner.c" - yylval = yylval_param; if ( !yyg->yy_init ) @@ -898,6 +911,12 @@ YY_DECL libconfig_yy_load_buffer_state(yyscanner ); } + { +#line 112 "scanner.l" + + +#line 919 "scanner.c" + while ( 1 ) /* loops until end-of-file is reached */ { yy_cp = yyg->yy_c_buf_p; @@ -915,7 +934,7 @@ YY_DECL yy_match: do { - register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)]; + register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)] ; if ( yy_accept[yy_current_state] ) { yyg->yy_last_accepting_state = yy_current_state; @@ -924,13 +943,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 >= 112 ) + if ( yy_current_state >= 123 ) 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_current_state != 111 ); + while ( yy_current_state != 122 ); yy_cp = yyg->yy_last_accepting_cpos; yy_current_state = yyg->yy_last_accepting_state; @@ -941,7 +960,7 @@ yy_find_action: if ( yy_act != YY_END_OF_BUFFER && yy_rule_can_match_eol[yy_act] ) { - int yyl; + yy_size_t yyl; for ( yyl = 0; yyl < yyleng; ++yyl ) if ( yytext[yyl] == '\n' ) @@ -1157,32 +1176,32 @@ YY_RULE_SETUP case 32: YY_RULE_SETUP #line 184 "scanner.l" -{ yylval->sval = yytext; return(TOK_NAME); } +{ yylval->fval = atof(yytext); return(TOK_FLOAT); } YY_BREAK case 33: YY_RULE_SETUP #line 185 "scanner.l" -{ yylval->fval = atof(yytext); return(TOK_FLOAT); } +{ yylval->ival = atoi(yytext); return(TOK_INTEGER); } YY_BREAK case 34: YY_RULE_SETUP #line 186 "scanner.l" -{ yylval->ival = atoi(yytext); return(TOK_INTEGER); } +{ yylval->llval = atoll(yytext); return(TOK_INTEGER64); } YY_BREAK case 35: YY_RULE_SETUP #line 187 "scanner.l" -{ yylval->llval = atoll(yytext); return(TOK_INTEGER64); } +{ yylval->ival = fromihex(yytext); return(TOK_HEX); } YY_BREAK case 36: YY_RULE_SETUP #line 188 "scanner.l" -{ yylval->ival = fromihex(yytext); return(TOK_HEX); } +{ yylval->llval = fromhex(yytext); return(TOK_HEX64); } YY_BREAK case 37: YY_RULE_SETUP #line 189 "scanner.l" -{ yylval->llval = fromhex(yytext); return(TOK_HEX64); } +{ yylval->sval = yytext; return(TOK_NAME); } YY_BREAK case 38: YY_RULE_SETUP @@ -1245,7 +1264,7 @@ YY_RULE_SETUP #line 209 "scanner.l" ECHO; YY_BREAK -#line 1249 "scanner.c" +#line 1268 "scanner.c" case YY_END_OF_BUFFER: { @@ -1375,6 +1394,7 @@ ECHO; "fatal flex scanner internal error--no action found" ); } /* end of action switch */ } /* end of scanning one token */ + } /* end of user's declarations */ } /* end of libconfig_yylex */ /* yy_get_next_buffer - try to read in a new buffer @@ -1542,7 +1562,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 >= 112 ) + if ( yy_current_state >= 123 ) yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; @@ -1571,11 +1591,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 >= 112 ) + if ( yy_current_state >= 123 ) 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 == 111); + yy_is_jam = (yy_current_state == 122); (void)yyg; return yy_is_jam ? 0 : yy_current_state; @@ -1997,7 +2017,7 @@ YY_BUFFER_STATE libconfig_yy_scan_bytes (yyconst char * yybytes, yy_size_t _yy YY_BUFFER_STATE b; char *buf; yy_size_t n; - int i; + yy_size_t i; /* Get memory for full buffer, including space for trailing EOB's. */ n = _yybytes_len + 2; |