mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-09 12:23:04 +00:00
* src/reader.h, src/reader.c (gram_error): ... can't get
yycontrol without making too strong assumptions on the parser itself. * src/output.c (prepare_tokens): Use the real 0th value of token_translations instead of `0'. * src/parse-gram.y (yyerror): Don't rely on yycontrol being visible here. * data/yacc.c (yyreport_parse_error): Rename yylocation as yylloc for the time being: %locations ought to provide it to yyerror.
This commit is contained in:
12
ChangeLog
12
ChangeLog
@@ -1,3 +1,15 @@
|
|||||||
|
2002-07-26 Akim Demaille <akim@epita.fr>
|
||||||
|
|
||||||
|
* src/reader.h, src/reader.c (gram_error): ... can't get
|
||||||
|
yycontrol without making too strong assumptions on the parser
|
||||||
|
itself.
|
||||||
|
* src/output.c (prepare_tokens): Use the real 0th value of
|
||||||
|
token_translations instead of `0'.
|
||||||
|
* src/parse-gram.y (yyerror): Don't rely on yycontrol being
|
||||||
|
visible here.
|
||||||
|
* data/yacc.c (yyreport_parse_error): Rename yylocation as yylloc
|
||||||
|
for the time being: %locations ought to provide it to yyerror.
|
||||||
|
|
||||||
2002-07-25 Akim Demaille <akim@epita.fr>
|
2002-07-25 Akim Demaille <akim@epita.fr>
|
||||||
|
|
||||||
* src/output.c (prepare_tokens): Go up to ntokens, not ntokens + 1.
|
* src/output.c (prepare_tokens): Go up to ntokens, not ntokens + 1.
|
||||||
|
|||||||
@@ -650,7 +650,7 @@ b4_c_function([yyreport_parse_error],
|
|||||||
[[int], [yystate]],
|
[[int], [yystate]],
|
||||||
[[int], [yychar]],
|
[[int], [yychar]],
|
||||||
[[YYSTYPE], [yyvalue]]b4_location_if([,
|
[[YYSTYPE], [yyvalue]]b4_location_if([,
|
||||||
[[YYLTYPE], [yylocation]]]))
|
[[YYLTYPE], [yylloc]]]))
|
||||||
[{
|
[{
|
||||||
#if YYERROR_VERBOSE
|
#if YYERROR_VERBOSE
|
||||||
int yyn = yypact[yystate];
|
int yyn = yypact[yystate];
|
||||||
@@ -705,7 +705,7 @@ b4_c_function([yyreport_parse_error],
|
|||||||
(void) yystate;
|
(void) yystate;
|
||||||
(void) yychar;
|
(void) yychar;
|
||||||
(void) yyvalue;
|
(void) yyvalue;
|
||||||
]b4_location_if([(void) yylocation;])[
|
]b4_location_if([(void) yylloc;])[
|
||||||
}]
|
}]
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -305,8 +305,9 @@ static void
|
|||||||
prepare_tokens (void)
|
prepare_tokens (void)
|
||||||
{
|
{
|
||||||
muscle_insert_symbol_number_table ("translate",
|
muscle_insert_symbol_number_table ("translate",
|
||||||
token_translations,
|
token_translations,
|
||||||
0, 1, max_user_token_number + 1);
|
token_translations[0],
|
||||||
|
1, max_user_token_number + 1);
|
||||||
|
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
/* A Bison parser, made from parse-gram.y, by GNU bison 1.49b. */
|
/* A Bison parser, made from parse-gram.y, by GNU bison 1.49b. */
|
||||||
|
|
||||||
/* Skeleton parser for Yacc-like parsing with Bison,
|
/* Skeleton parser for Yacc-like parsing with Bison,
|
||||||
Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002 Free Software Foundation, Inc.
|
Copyright 1984, 1989, 1990, 2000, 2001, 2002 Free Software Foundation, Inc.
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or modify
|
This program is free software; you can redistribute it and/or modify
|
||||||
it under the terms of the GNU General Public License as published by
|
it under the terms of the GNU General Public License as published by
|
||||||
@@ -91,11 +91,11 @@ do { \
|
|||||||
correctly typed access to it. */
|
correctly typed access to it. */
|
||||||
#define yycontrol ((gram_control_t *) gram_control)
|
#define yycontrol ((gram_control_t *) gram_control)
|
||||||
|
|
||||||
/* Request detailed parse error messages, and pass them to
|
/* Request detailed parse error messages, and pass them to GRAM_ERROR.
|
||||||
GRAM_ERROR. */
|
FIXME: depends on the undocumented availability of YYLLOC.t */
|
||||||
#undef yyerror
|
#undef yyerror
|
||||||
#define yyerror(Msg) \
|
#define yyerror(Msg) \
|
||||||
gram_error (yycontrol, &yylloc, Msg)
|
gram_error (&yylloc, Msg)
|
||||||
|
|
||||||
#define YYPRINT(File, Type, Value) \
|
#define YYPRINT(File, Type, Value) \
|
||||||
yyprint (File, Type, &Value)
|
yyprint (File, Type, &Value)
|
||||||
@@ -1846,9 +1846,32 @@ yyprint (FILE *file,
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
gram_error (gram_control_t *control ATTRIBUTE_UNUSED,
|
gram_error (location_t *yylloc, const char *msg)
|
||||||
location_t *yylloc, const char *msg)
|
|
||||||
{
|
{
|
||||||
complain_at (*yylloc, "%s", msg);
|
complain_at (*yylloc, "%s", msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* A Bison parser, made from parse-gram.y, by GNU bison 1.49b. */
|
||||||
|
|
||||||
|
/* Skeleton parser for Yacc-like parsing with Bison,
|
||||||
|
Copyright 1984, 1989, 1990, 2000, 2001, 2002 Free Software Foundation, Inc.
|
||||||
|
|
||||||
|
This program is free software; you can redistribute it and/or modify
|
||||||
|
it under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation; either version 2, or (at your option)
|
||||||
|
any later version.
|
||||||
|
|
||||||
|
This program is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with this program; if not, write to the Free Software
|
||||||
|
Foundation, Inc., 59 Temple Place - Suite 330,
|
||||||
|
Boston, MA 02111-1307, USA. */
|
||||||
|
|
||||||
|
/* As a special exception, when this file is copied by Bison into a
|
||||||
|
Bison output file, you may use that output file without restriction.
|
||||||
|
This special exception was added by the Free Software Foundation
|
||||||
|
in version 1.24 of Bison. */
|
||||||
|
|||||||
@@ -1,28 +1,3 @@
|
|||||||
/* A Bison parser, made from parse-gram.y, by GNU bison 1.49b. */
|
|
||||||
|
|
||||||
/* Skeleton parser for Yacc-like parsing with Bison,
|
|
||||||
Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002 Free Software Foundation, Inc.
|
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or modify
|
|
||||||
it under the terms of the GNU General Public License as published by
|
|
||||||
the Free Software Foundation; either version 2, or (at your option)
|
|
||||||
any later version.
|
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
|
||||||
along with this program; if not, write to the Free Software
|
|
||||||
Foundation, Inc., 59 Temple Place - Suite 330,
|
|
||||||
Boston, MA 02111-1307, USA. */
|
|
||||||
|
|
||||||
/* As a special exception, when this file is copied by Bison into a
|
|
||||||
Bison output file, you may use that output file without restriction.
|
|
||||||
This special exception was added by the Free Software Foundation
|
|
||||||
in version 1.24 of Bison. */
|
|
||||||
|
|
||||||
#ifndef BISON_PARSE_GRAM_H
|
#ifndef BISON_PARSE_GRAM_H
|
||||||
# define BISON_PARSE_GRAM_H
|
# define BISON_PARSE_GRAM_H
|
||||||
|
|
||||||
@@ -136,8 +111,8 @@ typedef union {
|
|||||||
char *string;
|
char *string;
|
||||||
assoc_t assoc;
|
assoc_t assoc;
|
||||||
} yystype;
|
} yystype;
|
||||||
/* Line 1271 of /usr/local/share/bison/yacc.c. */
|
/* Line 1270 of /usr/local/share/bison/yacc.c. */
|
||||||
#line 141 "y.tab.h"
|
#line 116 "y.tab.h"
|
||||||
# define YYSTYPE yystype
|
# define YYSTYPE yystype
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
@@ -64,11 +64,11 @@ do { \
|
|||||||
correctly typed access to it. */
|
correctly typed access to it. */
|
||||||
#define yycontrol ((gram_control_t *) gram_control)
|
#define yycontrol ((gram_control_t *) gram_control)
|
||||||
|
|
||||||
/* Request detailed parse error messages, and pass them to
|
/* Request detailed parse error messages, and pass them to GRAM_ERROR.
|
||||||
GRAM_ERROR. */
|
FIXME: depends on the undocumented availability of YYLLOC.t */
|
||||||
#undef yyerror
|
#undef yyerror
|
||||||
#define yyerror(Msg) \
|
#define yyerror(Msg) \
|
||||||
gram_error (yycontrol, &yylloc, Msg)
|
gram_error (&yylloc, Msg)
|
||||||
|
|
||||||
#define YYPRINT(File, Type, Value) \
|
#define YYPRINT(File, Type, Value) \
|
||||||
yyprint (File, Type, &Value)
|
yyprint (File, Type, &Value)
|
||||||
@@ -459,8 +459,7 @@ yyprint (FILE *file,
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
gram_error (gram_control_t *control ATTRIBUTE_UNUSED,
|
gram_error (location_t *yylloc, const char *msg)
|
||||||
location_t *yylloc, const char *msg)
|
|
||||||
{
|
{
|
||||||
complain_at (*yylloc, "%s", msg);
|
complain_at (*yylloc, "%s", msg);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -52,8 +52,7 @@ YY_DECL;
|
|||||||
|
|
||||||
/* From the parser. */
|
/* From the parser. */
|
||||||
extern int gram_debug;
|
extern int gram_debug;
|
||||||
void gram_error (gram_control_t *control,
|
void gram_error (location_t *loc, const char *msg);
|
||||||
location_t *loc, const char *msg);
|
|
||||||
int gram_parse (void *control);
|
int gram_parse (void *control);
|
||||||
|
|
||||||
/* The sort of braced code we are in. */
|
/* The sort of braced code we are in. */
|
||||||
|
|||||||
Reference in New Issue
Block a user