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: Tue, 17 Dec 2002 13:59:00 -0000 [thread overview]
Message-ID: <ro1y96omhn8.fsf@jackfruit.Stanford.EDU> (raw)
In-Reply-To: <200212172143.NAA14438@tully.CS.Berkeley.EDU>
On Tue, 17 Dec 2002 13:43:22 -0800, Paul Hilfinger <hilfingr@CS.Berkeley.EDU> said:
>> Unfortunately, some sort of distinction between types and non-types
>> seems to be hard-wired into the parser at a deep level: it seems to
>> be the parser's job to actually evaluate expressions corresponding
>> to types, whereas other expressions get evaluated by somebody else.
> Yes. This is a well-known issue with C++ parsing.
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. Basically, what
the parser is trying to parse isn't a C++ expression (which, as you
point out, is ridiculously difficult if you really want to do it
correctly) but is instead either an expression or a type, so that the
same parser can be used unmodified for either GDB's 'print' command or
its 'ptype' command.
I could be wrong, though.
David Carlton
carlton@math.stanford.edu
next prev parent reply other threads:[~2002-12-17 21:59 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 ` David Carlton [this message]
2002-12-18 19:36 ` c-exp.y Paul Hilfinger
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=ro1y96omhn8.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