0
{
char *yyd = yydest;
const char *yys = yysrc;
while ((*yyd++ = *yys++) != ' ')
continue;
return yyd - 1;
}
1.
endif
2.
endif
3.
if 0
/* This is so xgettext sees the translatable formats that are
constructed on the fly. */
YY_("syntax error, unexpected %s");
YY_("syntax error, unexpected %s, expecting %s");
YY_("syntax error, unexpected %s, expecting %s or %s");
YY_("syntax error, unexpected %s, expecting %s or %s or %s");
YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s");
4.
endif
char *yyfmt;
char const *yyf;
static char const yyunexpected[] = "syntax error, unexpected %s";
static char const yyexpecting[] = ", expecting %s";
static char const yyor[] = " or %s";
char yyformat[sizeof yyunexpected
+ sizeof yyexpecting - 1
+ ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2)
* (sizeof yyor - 1))];
char const *yyprefix = yyexpecting;
/* Start YYX at -YYN if negative to avoid negative indexes in
YYCHECK. */
int yyxbegin = yyn < 0 ? -yyn : 0;
/* Stay within bounds of both yycheck and yytname. */
int yychecklim = YYLAST - yyn + 1;
int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
int yycount = 1;
yyarg[0] = yytname[yytype];
yyfmt = yystpcpy (yyformat, yyunexpected);
for (yyx = yyxbegin; yyx < yyxend; ++yyx)
if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
{
if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
{
yycount = 1;
yysize = yysize0;
yyformat[sizeof yyunexpected - 1] = ' ';
break;
}
yyarg[yycount++] = yytname[yyx];
yysize1 = yysize + yytnamerr (0, yytname[yyx]);
yysize_overflow |= (yysize1 < yysize);
yysize = yysize1;
yyfmt = yystpcpy (yyfmt, yyprefix);
yyprefix = yyor;
}
yyf = YY_(yyformat);
yysize1 = yysize + yystrlen (yyf);
yysize_overflow |= (yysize1 < yysize);
yysize = yysize1;
if (yysize_overflow)
return YYSIZE_MAXIMUM;
if (yyresult)
{
/* Avoid sprintf, as that infringes on the user's name space.
Don't have undefined behavior even if the translation
produced a string with the wrong number of "%s"s. */
char *yyp = yyresult;
int yyi = 0;
while ((*yyp = *yyf) != ' ')
{
if (*yyp
'%' && yyf[1]
's' && yyi < yycount)
{
yyp += yytnamerr (yyp, yyarg[yyi++]);
yyf += 2;
}
else
{
yyp++;
yyf++;
}
}
}
return yysize;
}
}
5.
endif /* YYERROR_VERBOSE */
]b4_yydestruct_generate([b4_c_function_def])[
]b4_push_if([],
[[/* Prevent warnings from -Wmissing-prototypes. */
6.
ifdef YYPARSE_PARAM
]b4_c_function_decl([yyparse], [int],
[[void *YYPARSE_PARAM], [YYPARSE_PARAM]])[
7.
else /* ! YYPARSE_PARAM */
]b4_c_function_decl([yyparse], [int], b4_parse_param)[
8.
endif /* ! YYPARSE_PARAM */]])
m4_divert_push([KILL])#
M4 code.
9.
b4_declare_scanner_communication_variables
10.
---
11.
Declare the variables that are global, or local to YYPARSE if
12.
pure-parser.
m4_define([b4_declare_scanner_communication_variables],
[[/* The lookahead symbol. */
int yychar;
/* The semantic value of the lookahead symbol. */
YYSTYPE yylval;
]b4_locations_if([[
/* Location data for the lookahead symbol. */
YYLTYPE yylloc;
]])b4_pure_if([], [[
/* Number of syntax errors so far. */
int yynerrs;
]])])
13.
b4_declare_parser_state_variables
14.
---
15.
Declare all the variables that are needed to maintain the parser state
16.
between calls to yypush_parse.
m4_define([b4_declare_parser_state_variables],
[b4_pure_if([[ /* Number of syntax errors so far. */
int yynerrs;
]])[
int yystate;
/* Number of tokens to shift before error messages enabled. */
int yyerrstatus;
/* The stacks and their tools:
`yyss': related to states.
`yyvs': related to semantic values.]b4_locations_if([[
`yyls': related to locations.]])[
Refer to the stacks thru separate pointers, to allow yyoverflow
to reallocate them elsewhere. */
/* The state stack. */
yytype_int16 yyssa[YYINITDEPTH];
yytype_int16 *yyss;
yytype_int16 *yyssp;
/* The semantic value stack. */
YYSTYPE yyvsa[YYINITDEPTH];
YYSTYPE *yyvs;
YYSTYPE *yyvsp;
]b4_locations_if([[
/* The location stack. */
YYLTYPE yylsa[YYINITDEPTH];
YYLTYPE *yyls;
YYLTYPE *yylsp;
/* The locations where the error started and ended. */
YYLTYPE yyerror_range[2];
]])[
YYSIZE_T yystacksize;
]])
m4_divert_pop([KILL])dnl# == End of M4 code.
b4_pure_if([], [b4_declare_scanner_communication_variables])
b4_push_if(
[[struct yypstate
{
]b4_declare_parser_state_variables[
/* Used to determine if this is the first time this instance has
been used. */
int yynew;
};]b4_pure_if([], [[
static char yypstate_allocated = 0;]])b4_pull_if([
b4_c_function_def([[yyparse]], [[int]], b4_parse_param)[
{
return yypull_parse (0]m4_ifset([b4_parse_param],
[[, ]b4_c_args(b4_parse_param)])[);
}
]b4_c_function_def([[yypull_parse]], [[int]],
[[[yypstate *yyps]], [[yyps]]]m4_ifset([b4_parse_param], [,
b4_parse_param]))[
{
int yystatus;
yypstate *yyps_local;]b4_pure_if([[
int yychar;
YYSTYPE yylval;]b4_locations_if([[
YYLTYPE yylloc;]])])[
if (yyps == 0)
{
yyps_local = yypstate_new ();
if (!yyps_local)
{]b4_pure_if([[
yyerror (]b4_yyerror_args[YY_("memory exhausted"));]], [[
if (!yypstate_allocated)
yyerror (]b4_yyerror_args[YY_("memory exhausted"));]])[
return 2;
}
}
else
yyps_local = yyps;
do {
yychar = YYLEX;
yystatus =
yypush_parse (yyps_local]b4_pure_if([[, yychar, &yylval]b4_locations_if([[, &yylloc]])])m4_ifset([b4_parse_param], [, b4_c_args(b4_parse_param)])[);
} while (yystatus YYPUSH_MORE);
if (yyps
0)
yypstate_delete (yyps_local);
return yystatus;
}]])[
/* Initialize the parser data structure. */
]b4_c_function_def([[yypstate_new]], [[yypstate *]])[
{
yypstate *yyps;]b4_pure_if([], [[
if (yypstate_allocated)
return 0;]])[
yyps = (yypstate *) malloc (sizeof *yyps);
if (!yyps)
return 0;
yyps->yynew = 1;]b4_pure_if([], [[
yypstate_allocated = 1;]])[
return yyps;
}
]b4_c_function_def([[yypstate_delete]], [[void]],
[[[yypstate *yyps]], [[yyps]]])[
{
17.
ifndef yyoverflow
/* If the stack was reallocated but the parse did not complete, then the
stack still needs to be freed. */
if (!yyps->yynew && yyps->yyss != yyps->yyssa)
YYSTACK_FREE (yyps->yyss);
18.
endif
free (yyps);]b4_pure_if([], [[
yypstate_allocated = 0;]])[
}
]b4_pure_if([[#define ]b4_prefix[nerrs yyps->]b4_prefix[nerrs
]])[#define yystate yyps->yystate
19.
define yyerrstatus yyps->yyerrstatus
20.
define yyssa yyps->yyssa
21.
define yyss yyps->yyss
22.
define yyssp yyps->yyssp
23.
define yyvsa yyps->yyvsa
24.
define yyvs yyps->yyvs
25.
define yyvsp yyps->yyvsp
]b4_locations_if([[#define yylsa yyps->yylsa
26.
define yyls yyps->yyls
27.
define yylsp yyps->yylsp
28.
define yyerror_range yyps->yyerror_range
]])[#define yystacksize yyps->yystacksize
]])[
/---.
| yyparse or yypush_parse. |
`***/
]b4_push_if([
b4_c_function_def([[yypush_parse]], [[int]],
[[[yypstate *yyps]], [[yyps]]]b4_pure_if([,
[[[int yypushed_char]], [[yypushed_char]]],
[[[YYSTYPE const *yypushed_val]], [[yypushed_val]]]b4_locations_if([,
[[[YYLTYPE const *yypushed_loc]], [[yypushed_loc]]]])])m4_ifset([b4_parse_param], [,
b4_parse_param]))], [
29.
ifdef YYPARSE_PARAM
b4_c_function_def([yyparse], [int], [[void *YYPARSE_PARAM], [YYPARSE_PARAM]])
30.
else /* ! YYPARSE_PARAM */
b4_c_function_def([yyparse], [int], b4_parse_param)
31.
endif])[
{
]b4_pure_if([b4_declare_scanner_communication_variables])
b4_push_if([b4_pure_if([], [[ int yypushed_char = yychar;
YYSTYPE yypushed_val = yylval;
]b4_locations_if([[YYLTYPE yypushed_loc = yylloc;
]])])],
Tümünü Göster