* data/glr.c, data/yacc.c: Comment changes.
* data/lalr1.cc (yylex): Use #define to select the name of yylex,
so that one can refer to yylex in the parser file, and have it
renamed, as is the case with other skeletons.
+2004-12-16 Akim Demaille <akim@epita.fr>
+
+ Use #define to handle the %name-prefix.
+
+ * data/glr.c, data/yacc.c: Comment changes.
+ * data/lalr1.cc (yylex): Use #define to select the name of yylex,
+ so that one can refer to yylex in the parser file, and have it
+ renamed, as is the case with other skeletons.
+
2004-12-16 Akim Demaille <akim@epita.fr>
Move lalr1.cc internals into yy*.
]b4_identification
m4_if(b4_prefix[], [yy], [],
-[/* If NAME_PREFIX is specified substitute the variables and functions
- names. */
+[/* Substitute the variable and function names. */
#define yyparse b4_prefix[]parse
#define yylex b4_prefix[]lex
#define yyerror b4_prefix[]error
@output @output_parser_name@
b4_copyright([C++ Skeleton parser for LALR(1) parsing with Bison],
[2002, 2003, 2004])
-
-m4_if(b4_defines_flag, 0, [], [#include @output_header_name@])[
+m4_if(b4_prefix[], [yy], [],
+[
+// Take the name prefix into account.
+#define yylex b4_prefix[]lex])
+m4_if(b4_defines_flag, 0, [],
+[
+#include @output_header_name@])[
/* A pseudo ostream that takes yydebug_ into account. */
# define YYCDEBUG \
{
YYCDEBUG << "Reading a token: ";
#if YYLSP_NEEDED
- yylooka_ = ]m4_default(b4_prefix, [yy])[lex (&value, &location);
+ yylooka_ = yylex (&value, &location);
#else
- yylooka_ = ]m4_default(b4_prefix, [yy])[lex (&value);
+ yylooka_ = yylex (&value);
#endif
}
]b4_identification
m4_if(b4_prefix[], [yy], [],
-[/* If NAME_PREFIX is specified substitute the variables and functions
- names. */
+[/* Substitute the variable and function names. */
#define yyparse b4_prefix[]parse
#define yylex b4_prefix[]lex
#define yyerror b4_prefix[]error