This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: New C++ Parser
- To: Mark Mitchell <mark at codesourcery dot com>
- Subject: Re: New C++ Parser
- From: Per Bothner <per at bothner dot com>
- Date: 21 Oct 2000 13:50:09 -0700
- Cc: gcc at gcc dot gnu dot org
- References: <20001021125452E.mitchell@codesourcery.com>
Mark Mitchell <mark@codesourcery.com> writes:
Mark Mitchell <mark@codesourcery.com> writes:
> CodeSourcery has received a contract to implement a brand-new
> recursive-descent C++ parser, replacing the YACC version in the
> compiler at present.
>
> This work will have the following benefits:
> - ...
That is good news. Other possible benefits (I don't know enough to
other than guess/hope):
- Easier to debug than a yacc parser. (Don't have to understand
the detailed works of yacc.)
- Don't have hard-to-understand data and control flow dependencies
between lexer, parser, and rest of compiler.
- Likely to be smaller, since you don't have as many duplications
due to contortions to deal with complicated parts fo the grammar.
- Might be faster.
- If the C grammar is re-written as the same time, you can perhaps
share much of the code.
- Can use same grammer is other applications (such as gdb), some of
which might need a reentrant grammar, which is difficult with yacc.
(A re-entrant grammar was a goal for cppexp.c.)
--
--Per Bothner
per@bothner.com http://www.bothner.com/~per/