This is the mail archive of the archer@sourceware.org mailing list for the Archer project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Parser rewritting


>>>>> "Chris" == Chris Moller <cmoller@redhat.com> writes:

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
requirements.

Chris> And I'm just about certain it would be easier to use them than to
Chris> write a whole new parser--antlr is a lot less weird than bison.

My preferred route is to hand-write a recursive descent parser, mimicing
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
extensions.

Using a parser generator may be ok, but I think there are benefits to
following an existing parser.  Also, parsers like the one in g++ are
simpler to debug.  (Of course, maybe that is a problem we should solve
as well :-)

Tom


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]