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

On Wed, 18 Dec 2002 19:36:22 -0800, Paul Hilfinger <hilfingr@CS.Berkeley.EDU> said:

>> 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.

Ah, gotcha.  Good point.  I'll have to think about what to do with
this, then.  It seems like the two obvious options would be either to
have the lexer handle all double-colons, or else to have the lexer
handle none of them but to add a rule in the grammer converting a
possibly qualified name to a type.

And the former option doesn't work because the lexer doesn't have
enough smarts to let GDB do something useful with expressions of the
form C::x where x is a non-type member of C.  And the latter option
probably won't work for the reasons you are bringing up.

Sigh.  Certainly the short-term "fix" of extending the current hack in
yylex is looking more and more necessary.

David Carlton
carlton@math.stanford.edu


  reply	other threads:[~2002-12-19 19:58 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   ` c-exp.y Paul Hilfinger
2002-12-19 11:58     ` David Carlton [this message]
  -- 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=ro1adj1kcgr.fsf@jackfruit.Stanford.EDU \
    --to=carlton@math.stanford.edu \
    --cc=gdb@sources.redhat.com \
    --cc=hilfingr@CS.Berkeley.EDU \
    /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