# 02110-1301 USA
m4_include(b4_pkgdatadir/[c++.m4])
+
+# The header is mandatory.
+b4_defines_if([],
+ [m4_fatal(b4_skeleton[: using %defines is mandatory])])
+
# Backward compatibility.
m4_define([b4_location_constructors])
m4_include(b4_pkgdatadir/[location.cc])
# We do want M4 expansion after # for CPP macros.
m4_changecom()
m4_divert(0)dnl
-m4_if(b4_defines_flag, 0, [],
+b4_defines_if(
[@output @output_header_name@
b4_copyright([Skeleton interface for Bison LALR(1) parsers in C++],
[2002, 2003, 2004, 2005, 2006])
dnl FIXME: This is wrong, we want computed header guards.
[
-/* As a special exception, you may create a larger work that contains
- part or all of the Bison parser skeleton and distribute that work
- under terms of your choice, so long as that work isn't itself a
- parser generator using the skeleton or a modified version thereof
- as a parser skeleton. Alternatively, if you modify or redistribute
- the parser skeleton itself, you may (at your option) remove this
- special exception, which will cause the skeleton and the resulting
- Bison output files to be licensed under the GNU General Public
- License without this special exception.
-
- This special exception was added by the Free Software Foundation in
- version 2.2 of Bison. */
-
/* C++ LALR(1) parser skeleton written by Akim Demaille. */
#ifndef PARSER_HEADER_H
/* Enabling traces. */
#ifndef YYDEBUG
-# define YYDEBUG ]b4_debug[
+# define YYDEBUG ]b4_debug_flag[
#endif
/* Enabling verbose error messages. */
# undef YYERROR_VERBOSE
# define YYERROR_VERBOSE 1
#else
-# define YYERROR_VERBOSE ]b4_error_verbose[
+# define YYERROR_VERBOSE ]b4_error_verbose_flag[
#endif
/* Enabling the token table. */
virtual void yystack_print_ ();
#endif
- /// Convert a scanner token number to a symbol number.
- token_number_type yytranslate_ (int token);
+ /// Convert a scanner token number \a t to a symbol number.
+ token_number_type yytranslate_ (int t);
/// \brief Reclaim the memory associated to a symbol.
/// \param yymsg Why this token is reclaimed.
@output @output_parser_name@
b4_copyright([Skeleton implementation for Bison LALR(1) parsers in C++],
[2002, 2003, 2004, 2005, 2006])
-[
-/* As a special exception, you may create a larger work that contains
- part or all of the Bison parser skeleton and distribute that work
- under terms of your choice, so long as that work isn't itself a
- parser generator using the skeleton or a modified version thereof
- as a parser skeleton. Alternatively, if you modify or redistribute
- the parser skeleton itself, you may (at your option) remove this
- special exception, which will cause the skeleton and the resulting
- Bison output files to be licensed under the GNU General Public
- License without this special exception.
-
- This special exception was added by the Free Software Foundation in
- version 2.2 of Bison. */
-]
m4_if(b4_prefix, [yy], [],
[
// Take the name prefix into account.
#define yylex b4_prefix[]lex])
-m4_if(b4_defines_flag, 0, [],
-[
+b4_defines_if([
#include @output_header_name@])[
/* User implementation prologue. */
YYCDEBUG << "Reading a token: ";
yychar = ]b4_c_function_call([yylex], [int],
[[YYSTYPE*], [&yylval]][]dnl
-b4_location_if([, [[location*], [&yylloc]]])dnl
+b4_locations_if([, [[location*], [&yylloc]]])dnl
m4_ifdef([b4_lex_param], [, ]b4_lex_param))[;
}
/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
]b4_parser_class_name[::token_number_type
- ]b4_parser_class_name[::yytranslate_ (int token)
+ ]b4_parser_class_name[::yytranslate_ (int t)
{
static
const token_number_type
{
]b4_translate[
};
- if ((unsigned int) token <= yyuser_token_number_max_)
- return translate_table[token];
+ if ((unsigned int) t <= yyuser_token_number_max_)
+ return translate_table[t];
else
return yyundef_token_;
}
dnl
@output b4_dir_prefix[]stack.hh
b4_copyright([Stack handling for Bison parsers in C++],
- [2002, 2003, 2004, 2005, 2006])
-[
-/* As a special exception, you may create a larger work that contains
- part or all of the Bison parser skeleton and distribute that work
- under terms of your choice, so long as that work isn't itself a
- parser generator using the skeleton or a modified version thereof
- as a parser skeleton. Alternatively, if you modify or redistribute
- the parser skeleton itself, you may (at your option) remove this
- special exception, which will cause the skeleton and the resulting
- Bison output files to be licensed under the GNU General Public
- License without this special exception.
-
- This special exception was added by the Free Software Foundation in
- version 2.2 of Bison. */
+ [2002, 2003, 2004, 2005, 2006])[
#ifndef BISON_STACK_HH
# define BISON_STACK_HH