mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-19 17:23:02 +00:00
(_AT_TEST_GLR_CXXTYPES): Ensure yylex and
yyerror are declared before use; C99 requires this.
This commit is contained in:
@@ -40,6 +40,23 @@ $1
|
|||||||
#define YYINITDEPTH 10
|
#define YYINITDEPTH 10
|
||||||
static char* format (const char*, ...);
|
static char* format (const char*, ...);
|
||||||
|
|
||||||
|
struct YYLTYPE;
|
||||||
|
#if YYPURE
|
||||||
|
# if YYLSP_NEEDED
|
||||||
|
# define LEX_PARAMETERS YYSTYPE *lvalp, struct YYLTYPE *llocp
|
||||||
|
# define ERROR_PARAMETERS struct YYLTYPE *llocp, char const *s
|
||||||
|
# else
|
||||||
|
# define LEX_PARAMETERS YYSTYPE *lvalp
|
||||||
|
# endif
|
||||||
|
#endif
|
||||||
|
#ifndef LEX_PARAMETERS
|
||||||
|
# define LEX_PARAMETERS void
|
||||||
|
#endif
|
||||||
|
#ifndef ERROR_PARAMETERS
|
||||||
|
# define ERROR_PARAMETERS char const *s
|
||||||
|
#endif
|
||||||
|
int yylex (LEX_PARAMETERS);
|
||||||
|
int yyerror (ERROR_PARAMETERS);
|
||||||
%}
|
%}
|
||||||
|
|
||||||
%token TYPENAME ID
|
%token TYPENAME ID
|
||||||
@@ -101,13 +118,7 @@ main (int argc, char** argv)
|
|||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
#if YYPURE && YYLSP_NEEDED
|
yylex (LEX_PARAMETERS)
|
||||||
yylex (YYSTYPE *lvalp, YYLTYPE *llocp)
|
|
||||||
#elif YYPURE
|
|
||||||
yylex (YYSTYPE *lvalp)
|
|
||||||
#else
|
|
||||||
yylex ()
|
|
||||||
#endif
|
|
||||||
{
|
{
|
||||||
char buffer[256];
|
char buffer[256];
|
||||||
int c;
|
int c;
|
||||||
@@ -180,13 +191,13 @@ int
|
|||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
yyerror (
|
yyerror (ERROR_PARAMETERS)
|
||||||
#if YYPURE && YYLSP_NEEDED
|
|
||||||
YYLTYPE *llocp,
|
|
||||||
#endif
|
|
||||||
const char *s
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
|
#if YYPURE && YYLSP_NEEDED
|
||||||
|
/* Pacify GCC by using llocp. */
|
||||||
|
if (! llocp)
|
||||||
|
abort ();
|
||||||
|
#endif
|
||||||
fprintf (stderr, "%s\n", s);
|
fprintf (stderr, "%s\n", s);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user