Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
To: David Carlton <carlton@math.stanford.edu>
Cc: gdb <gdb@sources.redhat.com>
Subject: Re: c-exp.y
Date: Wed, 18 Dec 2002 19:36:00 -0000	[thread overview]
Message-ID: <200212190336.TAA20859@tully.CS.Berkeley.EDU> (raw)
In-Reply-To: Message from David Carlton <carlton@math.stanford.edu>  of "Tue, 17 Dec 2002 13:59:07 PST." <ro1y96omhn8.fsf@jackfruit.Stanford.EDU>


> I have heard that C++ parsing is a royal pain, but I'm not sure that's
> the issue here: I suspect that GDB's problems are at a more basic
> level.  I suspect that the division of labor between what the
> parse_expression does and what eval_expression does is a bit funny,
> and I'm pretty sure that the rule
> 
>   start   :     exp1
>           |     type_exp
>           ;
> 
> in the parser leads to some conceptual incoherence.  

It does, but it is not alone, which I guess was my point.  Look
further down in the grammar, and you find

    exp	:	'(' type ')' exp  %prec UNARY
			     ...
	    ;

    exp	:	'(' exp1 ')'
		{ }

which is essentially the same thing all over again.

The point is that there are instances in the C/C++ grammar that require
knowing whether a given identifier or qualified name is or is not a
type, which is why this sort of stuff tends to migrate into lexical
analysis.  

Paul Hilfinger


  reply	other threads:[~2002-12-19  3:36 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-12-17 13:43 c-exp.y Paul Hilfinger
2002-12-17 13:59 ` c-exp.y David Carlton
2002-12-18 19:36   ` Paul Hilfinger [this message]
2002-12-19 11:58     ` c-exp.y David Carlton
  -- strict thread matches above, loose matches on Subject: below --
2002-12-17 12:59 c-exp.y David Carlton

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=200212190336.TAA20859@tully.CS.Berkeley.EDU \
    --to=hilfingr@cs.berkeley.edu \
    --cc=carlton@math.stanford.edu \
    --cc=gdb@sources.redhat.com \
    /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