Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: "Pierre Muller" <pierre.muller@ics-cnrs.unistra.fr>
To: <gdb-patches@sourceware.org>
Subject: [RFC] pascal support sizeof (expression)
Date: Fri, 07 May 2010 15:31:00 -0000	[thread overview]
Message-ID: <004c01caedfa$50bef820$f23ce860$@muller@ics-cnrs.unistra.fr> (raw)

  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


             reply	other threads:[~2010-05-07 15:31 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-05-07 15:31 Pierre Muller [this message]
2010-05-07 16:11 ` Joel Brobecker
2010-05-08  9:20   ` Pierre Muller

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='004c01caedfa$50bef820$f23ce860$@muller@ics-cnrs.unistra.fr' \
    --to=pierre.muller@ics-cnrs.unistra.fr \
    --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