mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-18 16:53:02 +00:00
* src/bison.s1 (yyparse): Reorganize the definitions of the stacks
and related variables so that the similarities are highlighted.
This commit is contained in:
@@ -1,3 +1,8 @@
|
|||||||
|
2000-03-16 Akim Demaille <akim@epita.fr>
|
||||||
|
|
||||||
|
* src/bison.s1 (yyparse): Reorganize the definitions of the stacks
|
||||||
|
and related variables so that the similarities are highlighted.
|
||||||
|
|
||||||
2000-03-16 Akim Demaille <akim@epita.fr>
|
2000-03-16 Akim Demaille <akim@epita.fr>
|
||||||
|
|
||||||
* src/bison.s1: Properly indent CPP directives.
|
* src/bison.s1: Properly indent CPP directives.
|
||||||
|
|||||||
45
src/bison.s1
45
src/bison.s1
@@ -251,29 +251,37 @@ yyparse(YYPARSE_PARAM_ARG)
|
|||||||
{
|
{
|
||||||
register int yystate;
|
register int yystate;
|
||||||
register int yyn;
|
register int yyn;
|
||||||
register short *yyssp;
|
|
||||||
register YYSTYPE *yyvsp;
|
|
||||||
/* Number of tokens to shift before error messages enabled. */
|
/* Number of tokens to shift before error messages enabled. */
|
||||||
int yyerrstatus;
|
int yyerrstatus;
|
||||||
/* Lookahead token as an internal (translated) token number. */
|
/* Lookahead token as an internal (translated) token number. */
|
||||||
int yychar1 = 0;
|
int yychar1 = 0;
|
||||||
|
|
||||||
|
/* Three stacks and their tools:
|
||||||
|
`yyss': related to states,
|
||||||
|
`yysv': related to semantic values,
|
||||||
|
`yyls': related to locations.
|
||||||
|
|
||||||
|
Refer to the stacks thru separate pointers, to allow yyoverflow
|
||||||
|
to reallocate them elsewhere. */
|
||||||
|
|
||||||
/* The state stack. */
|
/* The state stack. */
|
||||||
short yyssa[YYINITDEPTH];
|
short yyssa[YYINITDEPTH];
|
||||||
|
short *yyss = yyssa;
|
||||||
|
register short *yyssp;
|
||||||
|
|
||||||
/* The semantic value stack. */
|
/* The semantic value stack. */
|
||||||
YYSTYPE yyvsa[YYINITDEPTH];
|
YYSTYPE yyvsa[YYINITDEPTH];
|
||||||
|
|
||||||
/* Refer to the stacks thru separate pointers. */
|
|
||||||
short *yyss = yyssa;
|
|
||||||
/* To allow yyoverflow to reallocate them elsewhere. */
|
|
||||||
YYSTYPE *yyvs = yyvsa;
|
YYSTYPE *yyvs = yyvsa;
|
||||||
|
register YYSTYPE *yyvsp;
|
||||||
|
|
||||||
#ifdef YYLSP_NEEDED
|
#ifdef YYLSP_NEEDED
|
||||||
/* The location stack. */
|
/* The location stack. */
|
||||||
YYLTYPE yylsa[YYINITDEPTH];
|
YYLTYPE yylsa[YYINITDEPTH];
|
||||||
YYLTYPE *yyls = yylsa;
|
YYLTYPE *yyls = yylsa;
|
||||||
YYLTYPE *yylsp;
|
YYLTYPE *yylsp;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef YYLSP_NEEDED
|
||||||
# define YYPOPSTACK (yyvsp--, yyssp--, yylsp--)
|
# define YYPOPSTACK (yyvsp--, yyssp--, yylsp--)
|
||||||
#else
|
#else
|
||||||
# define YYPOPSTACK (yyvsp--, yyssp--)
|
# define YYPOPSTACK (yyvsp--, yyssp--)
|
||||||
@@ -291,9 +299,10 @@ yyparse(YYPARSE_PARAM_ARG)
|
|||||||
# endif
|
# endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
YYSTYPE yyval; /* the variable used to return */
|
|
||||||
/* semantic values from the action */
|
/* The variable used to return semantic values from the action
|
||||||
/* routines */
|
routines. */
|
||||||
|
YYSTYPE yyval;
|
||||||
|
|
||||||
int yylen;
|
int yylen;
|
||||||
|
|
||||||
@@ -344,16 +353,16 @@ yynewstate:
|
|||||||
# ifdef YYLSP_NEEDED
|
# ifdef YYLSP_NEEDED
|
||||||
/* This used to be a conditional around just the two extra args,
|
/* This used to be a conditional around just the two extra args,
|
||||||
but that might be undefined if yyoverflow is a macro. */
|
but that might be undefined if yyoverflow is a macro. */
|
||||||
yyoverflow("parser stack overflow",
|
yyoverflow ("parser stack overflow",
|
||||||
&yyss1, size * sizeof (*yyssp),
|
&yyss1, size * sizeof (*yyssp),
|
||||||
&yyvs1, size * sizeof (*yyvsp),
|
&yyvs1, size * sizeof (*yyvsp),
|
||||||
&yyls1, size * sizeof (*yylsp),
|
&yyls1, size * sizeof (*yylsp),
|
||||||
&yystacksize);
|
&yystacksize);
|
||||||
# else
|
# else
|
||||||
yyoverflow("parser stack overflow",
|
yyoverflow ("parser stack overflow",
|
||||||
&yyss1, size * sizeof (*yyssp),
|
&yyss1, size * sizeof (*yyssp),
|
||||||
&yyvs1, size * sizeof (*yyvsp),
|
&yyvs1, size * sizeof (*yyvsp),
|
||||||
&yystacksize);
|
&yystacksize);
|
||||||
# endif
|
# endif
|
||||||
|
|
||||||
yyss = yyss1; yyvs = yyvs1;
|
yyss = yyss1; yyvs = yyvs1;
|
||||||
|
|||||||
@@ -251,29 +251,37 @@ yyparse(YYPARSE_PARAM_ARG)
|
|||||||
{
|
{
|
||||||
register int yystate;
|
register int yystate;
|
||||||
register int yyn;
|
register int yyn;
|
||||||
register short *yyssp;
|
|
||||||
register YYSTYPE *yyvsp;
|
|
||||||
/* Number of tokens to shift before error messages enabled. */
|
/* Number of tokens to shift before error messages enabled. */
|
||||||
int yyerrstatus;
|
int yyerrstatus;
|
||||||
/* Lookahead token as an internal (translated) token number. */
|
/* Lookahead token as an internal (translated) token number. */
|
||||||
int yychar1 = 0;
|
int yychar1 = 0;
|
||||||
|
|
||||||
|
/* Three stacks and their tools:
|
||||||
|
`yyss': related to states,
|
||||||
|
`yysv': related to semantic values,
|
||||||
|
`yyls': related to locations.
|
||||||
|
|
||||||
|
Refer to the stacks thru separate pointers, to allow yyoverflow
|
||||||
|
to reallocate them elsewhere. */
|
||||||
|
|
||||||
/* The state stack. */
|
/* The state stack. */
|
||||||
short yyssa[YYINITDEPTH];
|
short yyssa[YYINITDEPTH];
|
||||||
|
short *yyss = yyssa;
|
||||||
|
register short *yyssp;
|
||||||
|
|
||||||
/* The semantic value stack. */
|
/* The semantic value stack. */
|
||||||
YYSTYPE yyvsa[YYINITDEPTH];
|
YYSTYPE yyvsa[YYINITDEPTH];
|
||||||
|
|
||||||
/* Refer to the stacks thru separate pointers. */
|
|
||||||
short *yyss = yyssa;
|
|
||||||
/* To allow yyoverflow to reallocate them elsewhere. */
|
|
||||||
YYSTYPE *yyvs = yyvsa;
|
YYSTYPE *yyvs = yyvsa;
|
||||||
|
register YYSTYPE *yyvsp;
|
||||||
|
|
||||||
#ifdef YYLSP_NEEDED
|
#ifdef YYLSP_NEEDED
|
||||||
/* The location stack. */
|
/* The location stack. */
|
||||||
YYLTYPE yylsa[YYINITDEPTH];
|
YYLTYPE yylsa[YYINITDEPTH];
|
||||||
YYLTYPE *yyls = yylsa;
|
YYLTYPE *yyls = yylsa;
|
||||||
YYLTYPE *yylsp;
|
YYLTYPE *yylsp;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef YYLSP_NEEDED
|
||||||
# define YYPOPSTACK (yyvsp--, yyssp--, yylsp--)
|
# define YYPOPSTACK (yyvsp--, yyssp--, yylsp--)
|
||||||
#else
|
#else
|
||||||
# define YYPOPSTACK (yyvsp--, yyssp--)
|
# define YYPOPSTACK (yyvsp--, yyssp--)
|
||||||
@@ -291,9 +299,10 @@ yyparse(YYPARSE_PARAM_ARG)
|
|||||||
# endif
|
# endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
YYSTYPE yyval; /* the variable used to return */
|
|
||||||
/* semantic values from the action */
|
/* The variable used to return semantic values from the action
|
||||||
/* routines */
|
routines. */
|
||||||
|
YYSTYPE yyval;
|
||||||
|
|
||||||
int yylen;
|
int yylen;
|
||||||
|
|
||||||
@@ -344,16 +353,16 @@ yynewstate:
|
|||||||
# ifdef YYLSP_NEEDED
|
# ifdef YYLSP_NEEDED
|
||||||
/* This used to be a conditional around just the two extra args,
|
/* This used to be a conditional around just the two extra args,
|
||||||
but that might be undefined if yyoverflow is a macro. */
|
but that might be undefined if yyoverflow is a macro. */
|
||||||
yyoverflow("parser stack overflow",
|
yyoverflow ("parser stack overflow",
|
||||||
&yyss1, size * sizeof (*yyssp),
|
&yyss1, size * sizeof (*yyssp),
|
||||||
&yyvs1, size * sizeof (*yyvsp),
|
&yyvs1, size * sizeof (*yyvsp),
|
||||||
&yyls1, size * sizeof (*yylsp),
|
&yyls1, size * sizeof (*yylsp),
|
||||||
&yystacksize);
|
&yystacksize);
|
||||||
# else
|
# else
|
||||||
yyoverflow("parser stack overflow",
|
yyoverflow ("parser stack overflow",
|
||||||
&yyss1, size * sizeof (*yyssp),
|
&yyss1, size * sizeof (*yyssp),
|
||||||
&yyvs1, size * sizeof (*yyvsp),
|
&yyvs1, size * sizeof (*yyvsp),
|
||||||
&yystacksize);
|
&yystacksize);
|
||||||
# endif
|
# endif
|
||||||
|
|
||||||
yyss = yyss1; yyvs = yyvs1;
|
yyss = yyss1; yyvs = yyvs1;
|
||||||
|
|||||||
Reference in New Issue
Block a user