From 3877b7210eb630bfea25913bc2493133a7e93882 Mon Sep 17 00:00:00 2001 From: Akim Demaille Date: Mon, 13 Apr 2020 08:18:51 +0200 Subject: [PATCH] regen --- src/parse-gram.c | 19 +++++++++---------- src/parse-gram.h | 1 + 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/parse-gram.c b/src/parse-gram.c index f476a935..0100d6ba 100644 --- a/src/parse-gram.c +++ b/src/parse-gram.c @@ -898,8 +898,7 @@ static const yytype_int8 yyr2[] = enum { YYENOMEM = -2 }; #define yyerrok (yyerrstatus = 0) -#define yyclearin (yychar = YYEMPTY) -#define YYEMPTY (-2) +#define yyclearin (yychar = GRAM_EMPTY) #define YYACCEPT goto yyacceptlab #define YYABORT goto yyabortlab @@ -910,7 +909,7 @@ enum { YYENOMEM = -2 }; #define YYBACKUP(Token, Value) \ do \ - if (yychar == YYEMPTY) \ + if (yychar == GRAM_EMPTY) \ { \ yychar = (Token); \ yylval = (Value); \ @@ -1819,7 +1818,7 @@ YYLTYPE yylloc = yyloc_default; YYDPRINTF ((stderr, "Starting parse\n")); - yychar = YYEMPTY; /* Cause a token to be read. */ + yychar = GRAM_EMPTY; /* Cause a token to be read. */ /* User initialization code. */ { @@ -1943,7 +1942,7 @@ yybackup: /* Not known => get a lookahead token if don't already have one. */ /* YYCHAR is either empty, or end-of-input, or a valid lookahead. */ - if (yychar == YYEMPTY) + if (yychar == GRAM_EMPTY) { YYDPRINTF ((stderr, "Reading a token\n")); yychar = yylex (&yylval, &yylloc); @@ -1993,7 +1992,7 @@ yybackup: *++yylsp = yylloc; /* Discard the shifted token. */ - yychar = YYEMPTY; + yychar = GRAM_EMPTY; YY_LAC_DISCARD ("shift"); goto yynewstate; @@ -2619,7 +2618,7 @@ yyreduce: yyerrlab: /* Make sure we have latest lookahead translation. See comments at user semantic actions for why this is necessary. */ - yytoken = yychar == YYEMPTY ? YYSYMBOL_YYEMPTY : YYTRANSLATE (yychar); + yytoken = yychar == GRAM_EMPTY ? YYSYMBOL_YYEMPTY : YYTRANSLATE (yychar); /* If not already recovering from an error, report this error. */ if (!yyerrstatus) @@ -2628,7 +2627,7 @@ yyerrlab: { yypcontext_t yyctx = {yyssp, yyesa, &yyes, &yyes_capacity, yytoken, &yylloc}; - if (yychar != YYEMPTY) + if (yychar != GRAM_EMPTY) YY_LAC_ESTABLISH; if (yyreport_syntax_error (&yyctx) == 2) goto yyexhaustedlab; @@ -2652,7 +2651,7 @@ yyerrlab: { yydestruct ("Error: discarding", yytoken, &yylval, &yylloc); - yychar = YYEMPTY; + yychar = GRAM_EMPTY; } } @@ -2763,7 +2762,7 @@ yyexhaustedlab: | yyreturn -- parsing is finished, return the result. | `-----------------------------------------------------*/ yyreturn: - if (yychar != YYEMPTY) + if (yychar != GRAM_EMPTY) { /* Make sure we have latest lookahead translation. See comments at user semantic actions for why this is necessary. */ diff --git a/src/parse-gram.h b/src/parse-gram.h index 32a81e9f..66feb31c 100644 --- a/src/parse-gram.h +++ b/src/parse-gram.h @@ -77,6 +77,7 @@ extern int gram_debug; # define GRAM_TOKENTYPE enum gram_tokentype { + GRAM_EMPTY = -2, GRAM_EOF = 0, /* "end of file" */ GRAM_ERRCODE = 1, /* error */ GRAM_UNDEF = 2, /* "invalid token" */