This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

[RFA] Extend parse rules for const, volatile


[Jim, tapping you as someone knowledgeable]

The following change extends gdb's expression parser for types, 
so that in addition to accepting casts of the form
	(char const *)
it will also accept casts of the form
	(char * const)

Note that it still doesn't do anything with the "const"
or "volatile" information -- it merely accepts the expr.
2001-09-17  Michael Snyder  <msnyder@redhat.com>

	* c-exp.y (ptype): New rules for CONST_KEYWORD, VOLATILE_KEYWORD.

Index: c-exp.y
===================================================================
RCS file: /cvs/src/src/gdb/c-exp.y,v
retrieving revision 1.4
diff -c -3 -p -r1.4 c-exp.y
*** c-exp.y	2001/03/06 08:21:06	1.4
--- c-exp.y	2001/09/17 22:47:36
*************** ptype	:	typebase
*** 731,737 ****
--- 731,741 ----
  		{ $$ = follow_types ($1); }
  	|	typebase CONST_KEYWORD abs_decl
  		{ $$ = follow_types ($1); }
+ 	|	typebase abs_decl CONST_KEYWORD
+ 		{ $$ = follow_types ($1); }
  	|	typebase VOLATILE_KEYWORD abs_decl
+ 		{ $$ = follow_types ($1); }
+ 	|	typebase abs_decl VOLATILE_KEYWORD
  		{ $$ = follow_types ($1); }
  	;
  

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]