public inbox for archer@sourceware.org
 help / color / mirror / Atom feed
From: Chris Moller <cmoller@redhat.com>
To: Sergio Durigan Junior <sergiodj@redhat.com>
Cc: Project Archer <archer@sourceware.org>
Subject: Re: Parser rewritting
Date: Tue, 30 Mar 2010 19:05:00 -0000	[thread overview]
Message-ID: <4BB24B69.3000300@redhat.com> (raw)
In-Reply-To: <201003301546.34866.sergiodj@redhat.com>

There are a couple of antlr C++ parsers available:

http://hg.netbeans.org/main/file/tip/cnd.modelimpl/src/org/netbeans/modules/cnd/modelimpl/parser/cppparser.g

http://www.antlr.org/grammar/1198064893071/CPP_parser_v_3.2.zip

as well as a C++ preprocessor:

http://hg.netbeans.org/main/file/tip/cnd.apt/src/org/netbeans/modules/cnd/apt/impl/support/aptlexer.g

I don't know how easy/hard they'd be to adapt to use in GDB, but they 
might be worth looking at.  And I'm just about certain it would be 
easier to use them than to write a whole new parser--antlr is a lot less 
weird than bison.

There's antlr package in brewroot.

On 03/30/10 14:46, Sergio Durigan Junior wrote:
> Hello!
>
> As you may have noticed, in the last Archer meeting I brought a topic into
> discussion: the rewritting of the GDB's parser.  The current parser is written
> using Bison, and unfortunately it is insufficient to satisfy our current
> needs, especially for C++ productions.
>
> With that in mind, Tom asked me to start this discussion in the mailing-list
> to see what you think about it.  We decided to send an e-mail to the archer
> list at first; this topic will eventually be discussed at the gdb list as
> well.
>
> I am sorry I took so long to send this e-mail, but I was trying to come up
> with an initial plan to re-implement the parser.  I've been studying GCC/G++
> parsers in order to understand how they work, but I noticed that it would take
> some time for me to think in a good plan.  I also noticed that other people
> here have (much!!) more experience about parsers than I do, so why not
> exposing this idea and see what you think?
>
> The initial idea (by Tom) would be to mimic the current structure of the G++
> parser.  There is also another proposal (from Keith), but I don't know if he
> wants it to be listed here :-).  Feel free to post it, Keith!
>
> Any more ideas?  Comments about the exinsting ideas are also welcome, of
> course.  Meanwhile, I'll continue studying this parser stuff and will try to
> propose something useful in some time.
>
> Regards,
>
>    

  reply	other threads:[~2010-03-30 19:05 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-30 18:46 Sergio Durigan Junior
2010-03-30 19:05 ` Chris Moller [this message]
2010-03-30 21:12   ` Tom Tromey
2010-04-04  8:50     ` Dodji Seketeli
2010-04-08 19:28       ` Tom Tromey
2010-04-10 22:05         ` Jim Blandy
2010-04-10 22:11           ` Jim Blandy
2010-03-30 21:18 ` Tom Tromey
2010-03-30 22:20   ` Keith Seitz
2010-03-30 22:59     ` Tom Tromey
2010-03-31  2:01       ` Matt Rice
2010-04-02  1:50 ` Chris Moller
2010-04-08 19:21   ` Tom Tromey
2010-04-08 20:21     ` Chris Moller

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=4BB24B69.3000300@redhat.com \
    --to=cmoller@redhat.com \
    --cc=archer@sourceware.org \
    --cc=sergiodj@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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).