bison-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

FYI: lalr1.cc: %name-prefix for yylex


From: Akim Demaille
Subject: FYI: lalr1.cc: %name-prefix for yylex
Date: Wed, 15 Dec 2004 17:26:25 +0100
User-agent: Gnus/5.1007 (Gnus v5.10.7) Emacs/21.3 (gnu/linux)

Index: ChangeLog
from  Akim Demaille  <address@hidden>

        * data/lalr1.cc (lex_): Rename as...
        (yylex_): this.
        Move the trace here.
        Take the %name-prefix into account.
        Reported by Alexandre Duret-Lutz.

Index: data/lalr1.cc
===================================================================
RCS file: /cvsroot/bison/bison/data/lalr1.cc,v
retrieving revision 1.67
diff -u -u -r1.67 lalr1.cc
--- data/lalr1.cc 15 Dec 2004 16:18:11 -0000 1.67
+++ data/lalr1.cc 15 Dec 2004 16:29:26 -0000
@@ -243,7 +243,7 @@
 
   private:
 
-    virtual void lex_ ();
+    virtual void yylex_ ();
     virtual void error_ ();
     virtual void report_syntax_error_ ();
 #if YYDEBUG
@@ -521,10 +521,7 @@
 
   /* Read a look-ahead token.  */
   if (looka_ == empty_)
-    {
-      YYCDEBUG << "Reading a token: ";
-      lex_ ();
-    }
+    yylex_ ();
 
   /* Convert token to internal form.  */
   if (looka_ <= eof_)
@@ -757,12 +754,13 @@
 }
 
 void
-yy::]b4_parser_class_name[::lex_ ()
+yy::]b4_parser_class_name[::yylex_ ()
 {
+  YYCDEBUG << "Reading a token: ";
 #if YYLSP_NEEDED
-  looka_ = yylex (&value, &location);
+  looka_ = ]m4_default(b4_prefix, [yy])[lex (&value, &location);
 #else
-  looka_ = yylex (&value);
+  looka_ = ]m4_default(b4_prefix, [yy])[lex (&value);
 #endif
 }
 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]