This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


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

Re: New C++ Parser


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/

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