From: Daniel Berlin <dberlin@redhat.com>
To: Michael Elizabeth Chastain <chastain@cygnus.com>
Cc: gdb-patches@sources.redhat.com
Subject: Re: [PATCH] Handle comments in the C expression parser
Date: Tue, 13 Feb 2001 22:03:00 -0000 [thread overview]
Message-ID: <x7itmdrecc.fsf@dynamic-addr-83-177.resnet.rochester.edu> (raw)
In-Reply-To: <200102140543.VAA27887@bosch.cygnus.com>
Michael Elizabeth Chastain <chastain@cygnus.com> writes:
> Hi Daniel,
>
> > It has to, it's the lexer. It's doing the tokenizing.
>
> Fair enough. What happens here:
>
> (gdb) print /* multi line
> comment */ 1 + 2
>
> I bet it gives "unterminated comment" (as soon as you fix the code).
> This is a deviation from C, but it doesn't really bother me.
It shouldn't give that error, you should get an error as soon as you
hit enter after line.
Remember, we don't handle real multiline expressions. Adding a line
continuation character is doing just that, continuing the previous
line.
The expression lexer/parsers get handed (by the command that is
specified) whatever part of the line the various commands don't eat
themselves, AFAIK.
How am I so sure?
Well, we have no way, in our lexers, to get more input from the
user, or a stream. It only has the lexptr. It does no non-preprocessed (IE not
already gotten from the user and stored somewhere) input consuming of
it's own (it can't, or else, for example readline history, among a
billion other things, would fail for that input, since readline
wouldn't know about it).
Think of comments as ignored quoted strings with different start and
end chars. I know, it sounds like i'm saying "think of a car as a
bicycle with a steel frame, four wheels, an engine, etc", but they
really aren't dissimilar.
They are handled the same way in the lexer, except we don't care about
what's inside them, so the logic is a *lot* simpler.
>
> > Not in particular, I added it when someone suggested that, and wanted
> > to get it into the tree before it became a casualty of bitrot on one
> > of my trees ...
>
> I know the feeling.
>
> If I saw something useful about /* ... */ I'd be in favor, but right
> now, I'd just as soon see it scrapped.
Okeydokey, fine by me.
It's in the archives if it comes up later, at least.
On to better things.
:)
>
> Michael
next prev parent reply other threads:[~2001-02-13 22:03 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-02-13 21:43 Michael Elizabeth Chastain
2001-02-13 22:03 ` Daniel Berlin [this message]
-- 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:01 Michael Elizabeth Chastain
2001-02-13 21:30 ` 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=x7itmdrecc.fsf@dynamic-addr-83-177.resnet.rochester.edu \
--to=dberlin@redhat.com \
--cc=chastain@cygnus.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