mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-23 11:13:03 +00:00
* src/bison.hairy: Formatting/comment changes.
ANSIfy. Remove `register' indications. Add plenty of `static'.
This commit is contained in:
@@ -1,3 +1,10 @@
|
|||||||
|
2001-12-27 Akim Demaille <akim@epita.fr>
|
||||||
|
|
||||||
|
* src/bison.hairy: Formatting/comment changes.
|
||||||
|
ANSIfy.
|
||||||
|
Remove `register' indications.
|
||||||
|
Add plenty of `static'.
|
||||||
|
|
||||||
2001-12-27 Akim Demaille <akim@epita.fr>
|
2001-12-27 Akim Demaille <akim@epita.fr>
|
||||||
|
|
||||||
* src/output.c (prepare): Drop the muscle `ntbase' which
|
* src/output.c (prepare): Drop the muscle `ntbase' which
|
||||||
|
|||||||
147
src/bison.hairy
147
src/bison.hairy
@@ -1,27 +1,24 @@
|
|||||||
/* -*- C -*- */
|
/* -*- C -*- */
|
||||||
extern int timeclock;
|
|
||||||
|
|
||||||
|
/* YYERROR and YYCOST are set by guards. If yyerror is set to a
|
||||||
|
nonzero value by a guard, the reduction with which the guard is
|
||||||
|
associated is not performed, and the error recovery mechanism is
|
||||||
|
invoked. Yycost indicates the cost of performing the reduction
|
||||||
|
given the attributes of the symbols. */
|
||||||
|
static int yyerror;
|
||||||
|
static int yycost;
|
||||||
|
|
||||||
int yyerror; /* Yyerror and yycost are set by guards. */
|
/* YYMAXDEPTH indicates the size of the parser's state and value
|
||||||
int yycost; /* If yyerror is set to a nonzero value by a */
|
stacks. */
|
||||||
/* guard, the reduction with which the guard */
|
|
||||||
/* is associated is not performed, and the */
|
|
||||||
/* error recovery mechanism is invoked. */
|
|
||||||
/* Yycost indicates the cost of performing */
|
|
||||||
/* the reduction given the attributes of the */
|
|
||||||
/* symbols. */
|
|
||||||
|
|
||||||
|
|
||||||
/* YYMAXDEPTH indicates the size of the parser's state and value */
|
|
||||||
/* stacks. */
|
|
||||||
|
|
||||||
#ifndef YYMAXDEPTH
|
#ifndef YYMAXDEPTH
|
||||||
# define YYMAXDEPTH 500
|
# define YYMAXDEPTH 500
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* YYMAXRULES must be at least as large as the number of rules that */
|
/* YYMAXRULES must be at least as large as the number of rules that
|
||||||
/* could be placed in the rule queue. That number could be determined */
|
could be placed in the rule queue. That number could be determined
|
||||||
/* from the grammar and the size of the stack, but, as yet, it is not. */
|
from the grammar and the size of the stack, but, as yet, it is not.
|
||||||
|
*/
|
||||||
|
|
||||||
#ifndef YYMAXRULES
|
#ifndef YYMAXRULES
|
||||||
# define YYMAXRULES 100
|
# define YYMAXRULES 100
|
||||||
@@ -32,52 +29,60 @@ int yycost; /* If yyerror is set to a nonzero value by a */
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
short yyss[YYMAXDEPTH]; /* the state stack */
|
/* The state stack. */
|
||||||
YYSTYPE yyvs[YYMAXDEPTH]; /* the semantic value stack */
|
static short yyss[YYMAXDEPTH];
|
||||||
YYLTYPE yyls[YYMAXDEPTH]; /* the location stack */
|
/* The semantic value stack. */
|
||||||
short yyrq[YYMAXRULES]; /* the rule queue */
|
static YYSTYPE yyvs[YYMAXDEPTH];
|
||||||
int yychar; /* the lookahead symbol */
|
/* The location stack. */
|
||||||
|
static YYLTYPE yyls[YYMAXDEPTH];
|
||||||
|
/* The rule queue. */
|
||||||
|
static short yyrq[YYMAXRULES];
|
||||||
|
/* The lookahead symbol. */
|
||||||
|
static int yychar;
|
||||||
|
|
||||||
YYSTYPE yylval; /* the semantic value of the */
|
/* the semantic value of the lookahead symbol. */
|
||||||
/* lookahead symbol */
|
static YYSTYPE yylval;
|
||||||
|
|
||||||
YYSTYPE yytval; /* the semantic value for the state */
|
/* the semantic value for the state at the top of the state stack. */
|
||||||
/* at the top of the state stack. */
|
static YYSTYPE yytval;
|
||||||
|
|
||||||
YYSTYPE yyval; /* the variable used to return */
|
/* the variable used to return semantic values from the action
|
||||||
/* semantic values from the action */
|
routines. */
|
||||||
/* routines */
|
static YYSTYPE yyval;
|
||||||
|
|
||||||
YYLTYPE yylloc; /* location data for the lookahead */
|
/* location data for the lookahead symbol. */
|
||||||
/* symbol */
|
static YYLTYPE yylloc;
|
||||||
|
|
||||||
YYLTYPE yytloc; /* location data for the state at the */
|
/* location data for the state at the top of the state stack. */
|
||||||
/* top of the state stack */
|
static YYLTYPE yytloc;
|
||||||
|
|
||||||
|
|
||||||
int yynunlexed;
|
static int yynunlexed;
|
||||||
short yyunchar[YYMAXBACKUP];
|
static short yyunchar[YYMAXBACKUP];
|
||||||
YYSTYPE yyunval[YYMAXBACKUP];
|
static YYSTYPE yyunval[YYMAXBACKUP];
|
||||||
YYLTYPE yyunloc[YYMAXBACKUP];
|
static YYLTYPE yyunloc[YYMAXBACKUP];
|
||||||
|
|
||||||
short *yygssp; /* a pointer to the top of the state */
|
/* a pointer to the top of the state stack; only set during error
|
||||||
/* stack; only set during error */
|
recovery. */
|
||||||
/* recovery. */
|
static short *yygssp;
|
||||||
|
|
||||||
YYSTYPE *yygvsp; /* a pointer to the top of the value */
|
/* a pointer to the top of the value stack; only set during error
|
||||||
/* stack; only set during error */
|
recovery. */
|
||||||
/* recovery. */
|
static YYSTYPE *yygvsp;
|
||||||
|
|
||||||
YYLTYPE *yyglsp; /* a pointer to the top of the */
|
/* a pointer to the top of the location stack; only set during error
|
||||||
/* location stack; only set during */
|
recovery. */
|
||||||
/* error recovery. */
|
static YYLTYPE *yyglsp;
|
||||||
|
|
||||||
|
|
||||||
/* Yyget is an interface between the parser and the lexical analyzer. */
|
/*--------------------------------------------------------------------.
|
||||||
/* It is costly to provide such an interface, but it avoids requiring */
|
| Yyget is an interface between the parser and the lexical analyzer. |
|
||||||
/* the lexical analyzer to be able to back up the scan. */
|
| It is costly to provide such an interface, but it avoids requiring |
|
||||||
|
| the lexical analyzer to be able to back up the scan. |
|
||||||
|
`--------------------------------------------------------------------*/
|
||||||
|
|
||||||
yyget()
|
static inline void
|
||||||
|
yyget (void)
|
||||||
{
|
{
|
||||||
if (yynunlexed > 0)
|
if (yynunlexed > 0)
|
||||||
{
|
{
|
||||||
@@ -93,16 +98,14 @@ yyget()
|
|||||||
yychar = yylex ();
|
yychar = yylex ();
|
||||||
if (yychar < 0)
|
if (yychar < 0)
|
||||||
yychar = 0;
|
yychar = 0;
|
||||||
else yychar = YYTRANSLATE(yychar);
|
else
|
||||||
|
yychar = YYTRANSLATE (yychar);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static inline void
|
||||||
yyunlex(chr, val, loc)
|
yyunlex (int chr, YYSTYPE val, YYLTYPE loc)
|
||||||
int chr;
|
|
||||||
YYSTYPE val;
|
|
||||||
YYLTYPE loc;
|
|
||||||
{
|
{
|
||||||
yyunchar[yynunlexed] = chr;
|
yyunchar[yynunlexed] = chr;
|
||||||
yyunval[yynunlexed] = val;
|
yyunval[yynunlexed] = val;
|
||||||
@@ -111,16 +114,14 @@ YYLTYPE loc;
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static inline void
|
||||||
yyrestore(first, last)
|
yyrestore (short *first, short *last)
|
||||||
register short *first;
|
|
||||||
register short *last;
|
|
||||||
{
|
{
|
||||||
register short *ssp;
|
short *ssp;
|
||||||
register short *rp;
|
short *rp;
|
||||||
register int symbol;
|
int symbol;
|
||||||
register int state;
|
int state;
|
||||||
register int tvalsaved;
|
int tvalsaved;
|
||||||
|
|
||||||
ssp = yygssp;
|
ssp = yygssp;
|
||||||
yyunlex (yychar, yylval, yylloc);
|
yyunlex (yychar, yylval, yylloc);
|
||||||
@@ -173,14 +174,14 @@ register short *last;
|
|||||||
|
|
||||||
|
|
||||||
int
|
int
|
||||||
yyparse()
|
yyparse (void)
|
||||||
{
|
{
|
||||||
register int yystate;
|
int yystate;
|
||||||
register int yyn;
|
int yyn;
|
||||||
register short *yyssp;
|
short *yyssp;
|
||||||
register short *yyrq0;
|
short *yyrq0;
|
||||||
register short *yyptr;
|
short *yyptr;
|
||||||
register YYSTYPE *yyvsp;
|
YYSTYPE *yyvsp;
|
||||||
|
|
||||||
int yylen;
|
int yylen;
|
||||||
YYLTYPE *yylsp;
|
YYLTYPE *yylsp;
|
||||||
@@ -198,7 +199,8 @@ yyparse()
|
|||||||
yychar = yylex ();
|
yychar = yylex ();
|
||||||
if (yychar < 0)
|
if (yychar < 0)
|
||||||
yychar = 0;
|
yychar = 0;
|
||||||
else yychar = YYTRANSLATE(yychar);
|
else
|
||||||
|
yychar = YYTRANSLATE (yychar);
|
||||||
|
|
||||||
yynewstate:
|
yynewstate:
|
||||||
|
|
||||||
@@ -249,7 +251,6 @@ yyresume:
|
|||||||
yylsp++;
|
yylsp++;
|
||||||
if (yylen == 0)
|
if (yylen == 0)
|
||||||
{
|
{
|
||||||
yylsp->timestamp = timeclock;
|
|
||||||
yylsp->first_line = yytloc.first_line;
|
yylsp->first_line = yytloc.first_line;
|
||||||
yylsp->first_column = yytloc.first_column;
|
yylsp->first_column = yytloc.first_column;
|
||||||
yylsp->last_line = (yylsp - 1)->last_line;
|
yylsp->last_line = (yylsp - 1)->last_line;
|
||||||
|
|||||||
Reference in New Issue
Block a user