53
53
54
54
As of now (8.0.0), the mapping looks like this:
55
55
- PART 1: [0 .. 255] tokens of single-character lexemes
56
- - PART 2: [256 .. ...] tokens < NOT_A_TOKEN_SYM from sql_yacc.yy
57
- - PART 3: [... .. 999] reserved for sql_yacc.yy new tokens < NOT_A_TOKEN_SYM
56
+ - PART 2: [256 .. ...] tokens < YYUNDEF from sql_yacc.yy
57
+ - PART 3: [... .. 999] reserved for sql_yacc.yy new tokens < YYUNDEF
58
58
- PART 4: [1000 .. ...] tokens from sql_hints.yy
59
59
- PART 5: [... .. 1099] reserved for sql_hints.yy new tokens
60
60
- PART 6: [1100 .. ...] digest special fake tokens
61
61
- PART 7: [... .. 1149] reserved for new digest special fake tokens
62
- - PART 8: [1150 .. ...] tokens > NOT_A_TOKEN_SYM from sql_yacc.yy
62
+ - PART 8: [1150 .. ...] tokens > YYUNDEF from sql_yacc.yy
63
63
64
64
Should gen_lex_token fail when tokens are exhausted
65
65
(maybe you are reading this comment because of a fprintf(stderr) below),
@@ -237,10 +237,11 @@ struct range {
237
237
int max_seen;
238
238
};
239
239
240
- static_assert (NOT_A_TOKEN_SYM == 1150 ,
241
- " NOT_A_TOKEN_SYM should be equal to 1150" );
242
- range range_for_sql_yacc2{" sql/sql_yacc.yy (before NOT_A_TOKEN_SYM)" ,
243
- NOT_A_TOKEN_SYM, MY_MAX_TOKEN};
240
+ static_assert (YYUNDEF == 1150 ,
241
+ " YYUNDEF must be stable, because raw token numbers are used in "
242
+ " PFS digest calculations" );
243
+ range range_for_sql_yacc2{" sql/sql_yacc.yy (before YYUNDEF)" , YYUNDEF,
244
+ MY_MAX_TOKEN};
244
245
245
246
range range_for_digests{" digest specials" , 1100 , range_for_sql_yacc2.start - 1 };
246
247
@@ -249,7 +250,7 @@ static_assert(MAX_EXECUTION_TIME_HINT == 1000,
249
250
range range_for_sql_hints{" sql/sql_hints.yy" , MAX_EXECUTION_TIME_HINT,
250
251
range_for_digests.start - 1 };
251
252
252
- range range_for_sql_yacc1{" sql/sql_yacc.yy (after NOT_A_TOKEN_SYM )" , 256 ,
253
+ range range_for_sql_yacc1{" sql/sql_yacc.yy (after YYUNDEF )" , 256 ,
253
254
range_for_sql_hints.start - 1 };
254
255
255
256
int tok_generic_value = 0 ;
@@ -319,7 +320,7 @@ static void compute_tokens() {
319
320
*/
320
321
for (const SYMBOL &sym : symbols) {
321
322
if ((sym.group & SG_MAIN_PARSER) != 0 ) {
322
- if (sym.tok < NOT_A_TOKEN_SYM )
323
+ if (sym.tok < YYUNDEF )
323
324
range_for_sql_yacc1.set_token (sym.tok , sym.name , __LINE__);
324
325
else
325
326
range_for_sql_yacc2.set_token (sym.tok , sym.name , __LINE__);
0 commit comments