[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
FYI; lalr1.cc:
From: |
Akim Demaille |
Subject: |
FYI; lalr1.cc: |
Date: |
Thu, 16 Dec 2004 10:05:55 +0100 |
User-agent: |
Gnus/5.1007 (Gnus v5.10.7) Emacs/21.3 (gnu/linux) |
Index: ChangeLog
from Akim Demaille <address@hidden>
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.
Index: data/glr.c
===================================================================
RCS file: /cvsroot/bison/bison/data/glr.c,v
retrieving revision 1.85
diff -u -u -r1.85 glr.c
--- data/glr.c 14 Dec 2004 18:48:42 -0000 1.85
+++ data/glr.c 16 Dec 2004 09:04:57 -0000
@@ -149,8 +149,7 @@
]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
Index: data/lalr1.cc
===================================================================
RCS file: /cvsroot/bison/bison/data/lalr1.cc,v
retrieving revision 1.70
diff -u -u -r1.70 lalr1.cc
--- data/lalr1.cc 16 Dec 2004 08:48:54 -0000 1.70
+++ data/lalr1.cc 16 Dec 2004 09:04:57 -0000
@@ -373,8 +373,13 @@
@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 @address@hidden)[
+m4_if(b4_prefix[], [yy], [],
+[
+// Take the name prefix into account.
+#define yylex b4_prefix[]lex])
+m4_if(b4_defines_flag, 0, [],
+[
+#include @address@hidden)[
/* A pseudo ostream that takes yydebug_ into account. */
# define YYCDEBUG \
@@ -786,9 +791,9 @@
{
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
}
Index: data/yacc.c
===================================================================
RCS file: /cvsroot/bison/bison/data/yacc.c,v
retrieving revision 1.75
diff -u -u -r1.75 yacc.c
--- data/yacc.c 12 Dec 2004 09:25:24 -0000 1.75
+++ data/yacc.c 16 Dec 2004 09:04:57 -0000
@@ -153,8 +153,7 @@
]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
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- FYI; lalr1.cc:,
Akim Demaille <=