# GLR skeleton for Bison
-# Copyright (C) 2002-2012 Free Software Foundation, Inc.
+# Copyright (C) 2002-2013 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
[m4_ifset([b4_parse_param], [, b4_formals(b4_parse_param)])])
-# b4_lex_formals
-# --------------
-# All the yylex formal arguments.
-m4_define([b4_lex_formals],
-m4_dquote(b4_pure_if([[[[YYSTYPE *yylvalp]], [[&yylval]]][]dnl
-b4_locations_if([, [[YYLTYPE *yyllocp], [&yylloc]]])])dnl
-m4_ifdef([b4_lex_param], [, ]b4_lex_param)))
-
-
# b4_yyerror_args
# ---------------
# Optional effective arguments passed to yyerror: user args plus yylloc, and
b4_output_begin([b4_parser_file_name])
b4_copyright([Skeleton implementation for Bison GLR parsers in C],
- [2002-2012])[
+ [2002-2013])[
/* C GLR parser skeleton written by Paul Hilfinger. */
#define yyparse ]b4_prefix[parse
#define yylex ]b4_prefix[lex
#define yyerror ]b4_prefix[error
+#define yydebug ]b4_prefix[debug
+]]b4_pure_if([], [[
#define yylval ]b4_prefix[lval
#define yychar ]b4_prefix[char
-#define yydebug ]b4_prefix[debug
#define yynerrs ]b4_prefix[nerrs]b4_locations_if([[
-#define yylloc ]b4_prefix[lloc]])])[
+#define yylloc ]b4_prefix[lloc]])]))[
/* First part of user declarations. */
]b4_user_pre_prologue[
# endif
#endif
-/* Suppress unused-variable warnings by "using" E. */
-#ifdef __GNUC__
-# define YYUSE(E) ((void) (E))
-#else
-# define YYUSE(E) /* empty */
-#endif
-
#ifndef YYFREE
# define YYFREE free
#endif
# define YYLONGJMP(Env, Val) (longjmp (Env, Val), YYASSERT (0))
#endif
-/*-----------------.
-| GCC extensions. |
-`-----------------*/
-
-#ifndef __attribute__
-/* This feature is available in gcc versions 2.5 and later. */
-# if (! defined __GNUC__ || __GNUC__ < 2 \
- || (__GNUC__ == 2 && __GNUC_MINOR__ < 5))
-# define __attribute__(Spec) /* empty */
-# endif
-#endif
+]b4_attribute_define[
#ifndef YYASSERT
# define YYASSERT(Condition) ((void) ((Condition) || (abort (), 0)))
/* YYCONFL[I] -- lists of conflicting rule numbers, each terminated by
0, pointed into by YYCONFLP. */
]dnl Do not use b4_int_type_for here, since there are places where
-dnl pointers onto yyconfl are taken, which type is "short int *".
+dnl pointers onto yyconfl are taken, whose type is "short int *".
dnl We probably ought to introduce a type for confl.
[static const short int yyconfl[] =
{
]b4_yylloc_default_define[
# define YYRHSLOC(Rhs, K) ((Rhs)[K].yystate.yyloc)
]])[
-]b4_yy_location_print_define[
-
-/* YYLEX -- calling `yylex' with the right arguments. */
-#ifndef YYLEX
-# define YYLEX ]b4_function_call([yylex], [int], b4_lex_formals)[
-#endif
]b4_pure_if(
[
# define YYFPRINTF fprintf
# endif
+]b4_yy_location_print_define[
+
# define YYDPRINTF(Args) \
do { \
if (yydebug) \
* (@@$). Returns yyok for normal return, yyaccept for YYACCEPT,
* yyerr for YYERROR, yyabort for YYABORT. */
static YYRESULTTAG
-yyuserAction (yyRuleNum yyn, int yyrhslen, yyGLRStackItem* yyvsp,
+yyuserAction (yyRuleNum yyn, size_t yyrhslen, yyGLRStackItem* yyvsp,
yyGLRStack* yystackp,
YYSTYPE* yyvalp]b4_locuser_formals[)
{
(yystackp->yysplitPoint == YY_NULL);
int yylow;
]b4_parse_param_use([yyvalp], [yylocp])dnl
-[# undef yyerrok
+[ YYUSE (yyrhslen);
+# undef yyerrok
# define yyerrok (yystackp->yyerrState = 0)
# undef YYACCEPT
# define YYACCEPT return yyaccept
if (yychar == YYEMPTY)
{
YYDPRINTF ((stderr, "Reading a token: "));
- yychar = YYLEX;
+ yychar = ]b4_lex[;
}
if (yychar <= YYEOF)
yytoken, &yylval]b4_locuser_args([&yylloc])[);
}
YYDPRINTF ((stderr, "Reading a token: "));
- yychar = YYLEX;
+ yychar = ]b4_lex[;
if (yychar <= YYEOF)
{
yychar = yytoken = YYEOF;
if (yychar == YYEMPTY)
{
YYDPRINTF ((stderr, "Reading a token: "));
- yychar = YYLEX;
+ yychar = ]b4_lex[;
}
if (yychar <= YYEOF)
YYFPRINTF (stderr, "\n");
}
#endif
+
+#undef yylval
+#undef yychar
+#undef yynerrs]b4_locations_if([
+#undef yylloc])
+
+m4_if(b4_prefix, [yy], [],
+[[/* Substitute the variable and function names. */
+#define yyparse ]b4_prefix[parse
+#define yylex ]b4_prefix[lex
+#define yyerror ]b4_prefix[error
+#define yylval ]b4_prefix[lval
+#define yychar ]b4_prefix[char
+#define yydebug ]b4_prefix[debug
+#define yynerrs ]b4_prefix[nerrs]b4_locations_if([[
+#define yylloc ]b4_prefix[lloc]])])[
+
]b4_epilogue[]dnl
b4_output_end()
[b4_defines_if(
[b4_output_begin([b4_spec_defines_file])
b4_copyright([Skeleton interface for Bison GLR parsers in C],
- [2002-2012])[
+ [2002-2013])[
]b4_cpp_guard_open([b4_spec_defines_file])[
]b4_shared_declarations[