[PATCH] [WineDbg]: fixes for identifiers

Eric Pouech eric.pouech at wanadoo.fr
Sat Mar 25 03:12:45 CST 2006


- fixes lexical rules for a path name
- fixed identifier rules so that we get the right precedence
  between ! and ::
- modules (in mod!name forms) are now handled as tIDENTIFIER
  (tPATH was buggy anyhow)

A+
---

 programs/winedbg/dbg.y   |   12 ++++++++----
 programs/winedbg/debug.l |    2 +-
 2 files changed, 9 insertions(+), 5 deletions(-)

diff --git a/programs/winedbg/dbg.y b/programs/winedbg/dbg.y
index 4e97b09..42c8f66 100644
--- a/programs/winedbg/dbg.y
+++ b/programs/winedbg/dbg.y
@@ -86,7 +86,7 @@ int yyerror(const char*);
 %type <expression> expr lvalue
 %type <lvalue> expr_lvalue lvalue_addr
 %type <integer> expr_rvalue
-%type <string> pathname identifier
+%type <string> pathname identifier cpp_identifier
 %type <listing> list_arg
 %type <type> type_expr
 
@@ -162,14 +162,18 @@ pathname:
     | tPATH                     { $$ = $1; }
     ;
 
-identifier:
+cpp_identifier:
       tIDENTIFIER               { $$ = $1; }
-    | tPATH '!' tIDENTIFIER     { $$ = lexeme_alloc_size(strlen($1) + 1 + strlen($3) + 1);
-                                  sprintf($$, "%s!%s", $1, $3); }
     | identifier OP_SCOPE tIDENTIFIER { $$ = lexeme_alloc_size(strlen($1) + 2 + strlen($3) + 1);
                                        sprintf($$, "%s::%s", $1, $3); }
     ;
 
+identifier:
+      cpp_identifier            { $$ = $1; }
+    | tIDENTIFIER '!' cpp_identifier { $$ = lexeme_alloc_size(strlen($1) + 1 + strlen($3) + 1);
+                                       sprintf($$, "%s!%s", $1, $3); }
+    ;
+
 list_arg:
       tNUM		        { $$.FileName = NULL; $$.LineNumber = $1; }
     | pathname ':' tNUM	        { $$.FileName = $1; $$.LineNumber = $3; }
diff --git a/programs/winedbg/debug.l b/programs/winedbg/debug.l
index dd18a89..0a14e9a 100644
--- a/programs/winedbg/debug.l
+++ b/programs/winedbg/debug.l
@@ -77,7 +77,7 @@ DIGIT	   [0-9]
 HEXDIGIT   [0-9a-fA-F]
 FORMAT     [ubcdgiswx]
 IDENTIFIER [_a-zA-Z~?][_a-zA-Z0-9~?@]*
-PATHNAME   [-/_a-zA-Z\.~][-/_a-zA-Z0-9\.~@]*
+PATHNAME   [\\/-_a-zA-Z0-9\.~@]+
 STRING     \"[^\n"]+\"
 
 %s FORMAT_EXPECTED





More information about the wine-patches mailing list