From: Michael Elizabeth Chastain <chastain@cygnus.com>
To: dberlin@redhat.com, gdb-patches@sources.redhat.com
Subject: Re: [PATCH] Handle comments in the C expression parser
Date: Tue, 13 Feb 2001 21:01:00 -0000 [thread overview]
Message-ID: <200102140501.VAA27824@bosch.cygnus.com> (raw)
Hi Daniel,
! while (*lexptr != '*')
! lexptr++;
What happens if the user opens a comment with '/*' and does not close it?
It looks like lexptr will go off into the weeds.
Also I do not know if lexptr has access to the whole input in contiguous
memory, or if it gets fed chunks of characters as they arrive.
I can do stuff like this in gdb:
(gdb) print 1 + \
2
$1 = 3
On the design level, I am not opposed to adding in C style comments
in a C parser. But I am skeptical about the planned use for:
break 'Foo::Foo /* base */ (int)'
... which is what I presume you are working towards.
I thought about this name scheme some more:
Foo::Foo
Foo::Foo$Base
You remark that Foo::Foo$Base is not a constructor, because
"Foo$Base" != "Foo". I think that is actually a useful property.
Foo$Base really *is not* a constructor.
If gdb wanted to construct an object in a region of memory, it would call
one of the Foo::Foo constructors. It would never call Foo::Foo$Base.
And the same with Foo::~Foo versus Foo::~Foo$Base.
If there are multiple overloaded Foo::Foo's, the Foo::Foo$Base's
should not join in overload resolution.
I admit there are some ways that Foo::Foo$Base is like a constructor.
It does contain a copy of all the code that the user wrote for a constructor.
Its object code has source line number records that point back into
the C++ source code for the constructor. But I think it's useful to
model it as *not a constructor*, because it does not have the interface
(the programming contract) of a constructor.
Michael Elizabeth Chastain
<chastain@redhat.com>
"love without fear"
next reply other threads:[~2001-02-13 21:01 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-02-13 21:01 Michael Elizabeth Chastain [this message]
2001-02-13 21:30 ` Daniel Berlin
-- strict thread matches above, loose matches on Subject: below --
2001-02-13 22:50 Michael Elizabeth Chastain
2001-02-13 22:49 Michael Elizabeth Chastain
2001-02-13 22:09 Michael Elizabeth Chastain
2001-02-13 22:25 ` Daniel Berlin
2001-02-13 21:43 Michael Elizabeth Chastain
2001-02-13 22:03 ` Daniel Berlin
2001-02-13 20:07 Daniel Berlin
2001-02-13 23:28 ` Eli Zaretskii
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=200102140501.VAA27824@bosch.cygnus.com \
--to=chastain@cygnus.com \
--cc=dberlin@redhat.com \
--cc=gdb-patches@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