yacc: define dummy yytokname() and yystatname() macros if not yydebug

This commit is contained in:
cinap_lenrek 2023-08-27 19:09:57 +00:00
parent 93c94e8c40
commit 68bba88d78

View file

@ -4,19 +4,6 @@
#ifdef yydebug
#include "y.debug"
#else
#define yydebug 0
char* yytoknames[1]; /* for debugging */
char* yystates[1]; /* for debugging */
#endif
/* parser for yacc output */
int yynerrs = 0; /* number of errors */
int yyerrflag = 0; /* error recovery flag */
extern int fprint(int, char*, ...);
extern int sprint(char*, char*, ...);
char*
yytokname(int yyc)
@ -41,6 +28,17 @@ yystatname(int yys)
sprint(x, "<%d>\n", yys);
return x;
}
#else
#define yydebug 0
#define yytokname(x) ""
#define yystatname(x) ""
#endif
/* parser for yacc output */
int yynerrs = 0; /* number of errors */
int yyerrflag = 0; /* error recovery flag */
long
yylex1(void)