Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Keith Seitz <keiths@redhat.com>
To: gdb-patches@sourceware.org
Subject: [RFA] Token cleanup in c-exp.y
Date: Mon, 24 Aug 2009 23:06:00 -0000	[thread overview]
Message-ID: <4A9313C2.3050907@redhat.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 312 bytes --]

Hi,

The attached patch "fixes" two tokens in c-exp.y, "->*" and ".*", which 
were not previously recognized as tokens.

Keith

ChangeLog
2009-08-24  Keith Seitz  <keiths@redhat.com>

	* c-exp.y (tokentab3): Add new token, ARROW_STAR. Changed all users.
	(tokentab2): Add new token, DOT_STAR. Changed all users.

[-- Attachment #2: token-fix.patch --]
[-- Type: text/plain, Size: 1535 bytes --]

Index: c-exp.y
===================================================================
RCS file: /cvs/src/src/gdb/c-exp.y,v
retrieving revision 1.59
diff -u -p -r1.59 c-exp.y
--- c-exp.y	7 Jul 2009 21:33:48 -0000	1.59
+++ c-exp.y	24 Aug 2009 20:41:09 -0000
@@ -232,7 +232,7 @@ static int parse_number (char *, int, in
 %left '+' '-'
 %left '*' '/' '%'
 %right UNARY INCREMENT DECREMENT
-%right ARROW '.' '[' '('
+%right ARROW ARROW_STAR '.' DOT_STAR '[' '('
 %token <ssym> BLOCKNAME 
 %token <bval> FILENAME
 %type <bval> block
@@ -333,7 +333,7 @@ exp	:	exp ARROW qualified_name
 			  write_exp_elt_opcode (STRUCTOP_MPTR); }
 	;
 
-exp	:	exp ARROW '*' exp
+exp	:	exp ARROW_STAR exp
 			{ write_exp_elt_opcode (STRUCTOP_MPTR); }
 	;
 
@@ -368,7 +368,7 @@ exp	:	exp '.' qualified_name
 			  write_exp_elt_opcode (STRUCTOP_MEMBER); }
 	;
 
-exp	:	exp '.' '*' exp
+exp	:	exp DOT_STAR exp
 			{ write_exp_elt_opcode (STRUCTOP_MEMBER); }
 	;
 
@@ -1664,7 +1664,8 @@ struct token
 static const struct token tokentab3[] =
   {
     {">>=", ASSIGN_MODIFY, BINOP_RSH, 0},
-    {"<<=", ASSIGN_MODIFY, BINOP_LSH, 0}
+    {"<<=", ASSIGN_MODIFY, BINOP_LSH, 0},
+    {"->*", ARROW_STAR, BINOP_END, 1}
   };
 
 static const struct token tokentab2[] =
@@ -1688,7 +1689,8 @@ static const struct token tokentab2[] =
     {"==", EQUAL, BINOP_END, 0},
     {"!=", NOTEQUAL, BINOP_END, 0},
     {"<=", LEQ, BINOP_END, 0},
-    {">=", GEQ, BINOP_END, 0}
+    {">=", GEQ, BINOP_END, 0},
+    {".*", DOT_STAR, BINOP_END, 0}
   };
 
 /* Identifier-like tokens.  */

             reply	other threads:[~2009-08-24 22:27 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-08-24 23:06 Keith Seitz [this message]
2009-08-24 23:08 ` Tom Tromey
2009-08-25  5:03   ` Keith Seitz
2009-08-25 13:45     ` Pierre Muller
2009-08-25 14:10       ` Jiang Jilin
2009-08-25 15:11         ` Andreas Schwab
2009-08-25 15:28 ` Matt Rice
2009-08-25 15:46   ` Tom Tromey
2009-08-25 15:47 ` Tom Tromey
2009-08-25 18:07   ` Keith Seitz
2009-08-25 18:41     ` Tom Tromey
2009-08-25 18:42       ` Keith Seitz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4A9313C2.3050907@redhat.com \
    --to=keiths@redhat.com \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox