This is the mail archive of the
mailing list for the Archer project.
Re: Parser rewritting
- From: Dodji Seketeli <dodji at redhat dot com>
- To: Tom Tromey <tromey at redhat dot com>
- Cc: Chris Moller <cmoller at redhat dot com>, Sergio Durigan Junior <sergiodj at redhat dot com>, Project Archer <archer at sourceware dot org>
- Date: Sun, 4 Apr 2010 10:49:52 +0200
- Subject: Re: Parser rewritting
- References: <firstname.lastname@example.org><4BB24B69.email@example.com><firstname.lastname@example.org>
On Tue, Mar 30, 2010 at 03:12:26PM -0600, Tom Tromey wrote:
> Chris> There are a couple of antlr C++ parsers available:
> Chris> http://hg.netbeans.org/main/file/tip/cnd.modelimpl/src/org/netbeans/modules/cnd/modelimpl/parser/cppparser.g
> We can't generally reuse code like this due to copyright assignment
Would the copyright assignment requirements prevent us from trying to
reuse, say, Clang? Maybe one could think about providing a C api on top
of Clang and consider Clang as an external dependency? If not, then my
point was to explicitely mention it and make sure we did consider the
option and ruled it out based on sound reasons.
> My preferred route is to hand-write a recursive descent parser,
> the structure of the existing code in g++.
> I think directly sharing code is impractical due to impedance mismatch
> between gdb and g++ internals. Also our goals are slightly different,
> in that in gdb we only need to parse expressions, we want a single
> parser for C and C++, and finally gdb must implement certain language
I understand that this minimal parser is meant to stay simple, e.g. no
preprocessing support, very minimal error reporting if any at all, no
semantic analysis etc, but still, if we can't re-use Clang, then would
it be possible to devise this new "minimal parser" as an independant,
reusable library with its own dejagnu-free testsuite?
Maybe other projects might be interested in using (and extending)
something like that.