Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [RFC] pascal support sizeof (expression)
@ 2010-05-07 15:31 Pierre Muller
  2010-05-07 16:11 ` Joel Brobecker
  0 siblings, 1 reply; 3+ messages in thread
From: Pierre Muller @ 2010-05-07 15:31 UTC (permalink / raw)
  To: gdb-patches

  The pascal parser only supports
sizeof (type), whereas c allows sizeof (expression).
  sizeof (var) is also a valid construction inside
a pascal source, thus I want to add it to the parser.

  Once more, I ask before committing because I am
unsure about the ChangeLog entry:

  - How should I describe this lexical rule addition?

  - Is it correct to put it inside 'pascal_parse'?
That is the name of the function in the
generated file p-exp.c.



Pierre Muller
Pascal language support maintainer for GDB

2010-05-07  Pierre Muller  <muller@ics.u-strasbg.fr>

	* p-exp.y (pascal_parse): Add support for `sizeof (expression)'.

Index: src/gdb/p-exp.y
===================================================================
RCS file: /cvs/src/src/gdb/p-exp.y,v
retrieving revision 1.49
diff -u -p -r1.49 p-exp.y
--- src/gdb/p-exp.y	6 May 2010 00:08:44 -0000	1.49
+++ src/gdb/p-exp.y	6 May 2010 23:06:14 -0000
@@ -525,6 +525,9 @@ exp	:	SIZEOF '(' type ')'	%prec UNARY
 			  write_exp_elt_opcode (OP_LONG); }
 	;
 
+exp	:	SIZEOF  '(' exp ')'      %prec UNARY
+			{ write_exp_elt_opcode (UNOP_SIZEOF); }
+	
 exp	:	STRING
 			{ /* C strings are converted into array constants
with
 			     an explicit null byte added at the end.  Thus


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2010-05-08  9:20 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-05-07 15:31 [RFC] pascal support sizeof (expression) Pierre Muller
2010-05-07 16:11 ` Joel Brobecker
2010-05-08  9:20   ` Pierre Muller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox