public inbox for gdb-cvs@sourceware.org
help / color / mirror / Atom feed
* [binutils-gdb] Remove the Ada DOT_ALL token
@ 2022-04-04 18:50 Tom Tromey
  0 siblings, 0 replies; only message in thread
From: Tom Tromey @ 2022-04-04 18:50 UTC (permalink / raw)
  To: gdb-cvs

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=02a8d05fc67915ada76b45f9f10b11baf57d5278

commit 02a8d05fc67915ada76b45f9f10b11baf57d5278
Author: Tom Tromey <tromey@adacore.com>
Date:   Tue Feb 22 12:56:09 2022 -0700

    Remove the Ada DOT_ALL token
    
    The Ada parser has a DOT_ALL token to represent ".all", and another
    token to represent other ".<identifier>" forms.  However, for
    completion it is a bit more convenient to unify these cases, so this
    patch removes DOT_ALL.

Diff:
---
 gdb/ada-exp.y | 18 +++++++++---------
 gdb/ada-lex.l |  2 --
 2 files changed, 9 insertions(+), 11 deletions(-)

diff --git a/gdb/ada-exp.y b/gdb/ada-exp.y
index 204e77af6ca..d84cdcebf58 100644
--- a/gdb/ada-exp.y
+++ b/gdb/ada-exp.y
@@ -448,8 +448,6 @@ make_tick_completer (struct stoken tok)
 %type <bval> block
 %type <lval> arglist tick_arglist
 
-%token DOT_ALL
-
 /* Special type cases, put in to allow the parser to distinguish different
    legal basetypes.  */
 %token <sval> DOLLAR_VARIABLE
@@ -477,7 +475,7 @@ make_tick_completer (struct stoken tok)
  /* The following are right-associative only so that reductions at this
     precedence have lower precedence than '.' and '('.  The syntax still
     forces a.b.c, e.g., to be LEFT-associated.  */
-%right '.' '(' '[' DOT_ID DOT_ALL
+%right '.' '(' '[' DOT_ID
 
 %token NEW OTHERS
 
@@ -506,15 +504,17 @@ exp1	:	exp
 	;
 
 /* Expressions, not including the sequencing operator.  */
-primary :	primary DOT_ALL
-			{ ada_wrap<ada_unop_ind_operation> (); }
-	;
 
 primary :	primary DOT_ID
 			{
-			  operation_up arg = ada_pop ();
-			  pstate->push_new<ada_structop_operation>
-			    (std::move (arg), copy_name ($2));
+			  if (strcmp ($2.ptr, "all") == 0)
+			    ada_wrap<ada_unop_ind_operation> ();
+			  else
+			    {
+			      operation_up arg = ada_pop ();
+			      pstate->push_new<ada_structop_operation>
+				(std::move (arg), copy_name ($2));
+			    }
 			}
 	;
 
diff --git a/gdb/ada-lex.l b/gdb/ada-lex.l
index 40e450bf679..9e35776d7c2 100644
--- a/gdb/ada-lex.l
+++ b/gdb/ada-lex.l
@@ -289,8 +289,6 @@ false		{ return FALSEKEYWORD; }
 		    }
 		}
 
-"."{WHITE}*all  { return DOT_ALL; }
-
 "."{WHITE}*{ID} {
 	 	  yylval.sval = processId (yytext+1, yyleng-1);
 	          return DOT_ID;


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-04-04 18:50 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-04 18:50 [binutils-gdb] Remove the Ada DOT_ALL token Tom Tromey

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).