Alexandre Julliard : winedbg: Change the prefix on bison-generated names to avoid the name-prefix directive .

Alexandre Julliard julliard at wine.codeweavers.com
Tue Sep 12 07:30:06 CDT 2006


Module: wine
Branch: master
Commit: 1be6e9a6b1dc3007a66e4fe69b693774e9859298
URL:    http://source.winehq.org/git/?p=wine.git;a=commit;h=1be6e9a6b1dc3007a66e4fe69b693774e9859298

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Tue Sep 12 09:04:43 2006 +0200

winedbg: Change the prefix on bison-generated names to avoid the name-prefix directive.

---

 programs/winedbg/dbg.y   |   10 ++++------
 programs/winedbg/debug.l |   26 +++++++++++++-------------
 2 files changed, 17 insertions(+), 19 deletions(-)

diff --git a/programs/winedbg/dbg.y b/programs/winedbg/dbg.y
index 56efb94..ea28b54 100644
--- a/programs/winedbg/dbg.y
+++ b/programs/winedbg/dbg.y
@@ -35,13 +35,11 @@ #include "debugger.h"
 #include "wine/exception.h"
 #include "expr.h"
 
-int yylex(void);
-int yyerror(const char*);
+int dbg_lex(void);
+static int dbg_error(const char*);
 
 %}
 
-%name-prefix="yy"
-
 %union
 {
     struct dbg_lvalue   lvalue;
@@ -530,7 +528,7 @@ void	parser_handle(HANDLE input)
        __TRY
        {
 	  ret_ok = TRUE;
-	  yyparse();
+	  dbg_parse();
        }
        __EXCEPT(wine_dbg_cmd)
        {
@@ -554,7 +552,7 @@ void parser(const char* filename)
     }
 }
 
-int yyerror(const char* s)
+int dbg_error(const char* s)
 {
     dbg_printf("%s\n", s);
     return 0;
diff --git a/programs/winedbg/debug.l b/programs/winedbg/debug.l
index 9fef183..451c96d 100644
--- a/programs/winedbg/debug.l
+++ b/programs/winedbg/debug.l
@@ -19,7 +19,7 @@
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
  */
 
-%option nounput interactive 8bit
+%option nounput interactive 8bit prefix="dbg_"
 
 %{
 #include <stdlib.h>
@@ -104,7 +104,7 @@ STRING     \"[^\n"]+\"
                                         /* This rule must precede the ones below, */
                                         /* otherwise paths like '/' or '0x9' would */
                                         /* get parsed as an operator or tNUM */
-<PATH_EXPECTED>{PATHNAME}		{ yylval.string = lexeme_alloc(yytext); return tPATH; }
+<PATH_EXPECTED>{PATHNAME}		{ dbg_lval.string = lexeme_alloc(yytext); return tPATH; }
 
 "||"					{ return OP_LOR; }
 "&&"					{ return OP_LAND; }
@@ -120,19 +120,19 @@ STRING     \"[^\n"]+\"
 "["					{ return *yytext; }
 "]"					{ return *yytext; }
 
-"0x"{HEXDIGIT}+      			{ sscanf(yytext, "%x", &yylval.integer); return tNUM; }
-{DIGIT}+             			{ sscanf(yytext, "%d", &yylval.integer); return tNUM; }
+"0x"{HEXDIGIT}+      			{ sscanf(yytext, "%x", &dbg_lval.integer); return tNUM; }
+{DIGIT}+             			{ sscanf(yytext, "%d", &dbg_lval.integer); return tNUM; }
 
 <FORMAT_EXPECTED>"/"{DIGIT}+{FORMAT}	{ char* last;
-                                          yylval.integer = strtol(yytext+1, &last, 0) << 8;
-                                          yylval.integer |= *last;
+                                          dbg_lval.integer = strtol(yytext+1, &last, 0) << 8;
+                                          dbg_lval.integer |= *last;
                                           return tFORMAT; }
 
-<FORMAT_EXPECTED>"/"{FORMAT}          	{ yylval.integer = (1 << 8) | yytext[1]; return tFORMAT; }
+<FORMAT_EXPECTED>"/"{FORMAT}          	{ dbg_lval.integer = (1 << 8) | yytext[1]; return tFORMAT; }
 
-{STRING} 				{ yylval.string = lexeme_alloc(yytext + 1); yylval.string[strlen(yylval.string) - 1] = '\0'; return tSTRING; }
+{STRING} 				{ dbg_lval.string = lexeme_alloc(yytext + 1); dbg_lval.string[strlen(dbg_lval.string) - 1] = '\0'; return tSTRING; }
 <ASTRING_EXPECTED>[^\n]+                { char* p = yytext; while (*p == ' ' || *p == '\t') p++;
-                                          yylval.string = lexeme_alloc(p); return tSTRING; }
+                                          dbg_lval.string = lexeme_alloc(p); return tSTRING; }
 
 <INITIAL,NOPROCESS>info|inf|in		{ BEGIN(INFO_CMD); return tINFO; }
 <INITIAL>up				{ BEGIN(NOCMD); return tUP; }
@@ -214,8 +214,8 @@ union					{ return tUNION; }
 enum					{ return tENUM; }
 all                                     { return tALL; }
 
-{IDENTIFIER}				{ yylval.string = lexeme_alloc(yytext); return tIDENTIFIER; }
-"$"{IDENTIFIER}				{ yylval.string = lexeme_alloc(yytext+1); return tINTVAR; }
+{IDENTIFIER}				{ dbg_lval.string = lexeme_alloc(yytext); return tIDENTIFIER; }
+"$"{IDENTIFIER}				{ dbg_lval.string = lexeme_alloc(yytext+1); return tINTVAR; }
 
 <*>[ \t\r]+                             /* Eat up whitespace and DOS LF */
 
@@ -223,8 +223,8 @@ all                                     
 <*>.                                    { if (syntax_error == 0) { syntax_error++; dbg_printf("Syntax Error (%s)\n", yytext); } }
 %%
 
-#ifndef yywrap
-int yywrap(void) { return 1; }
+#ifndef dbg_wrap
+int dbg_wrap(void) { return 1; }
 #endif
 
 static char** local_lexemes /* = NULL */;




More information about the wine-cvs mailing list