This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Hand-written rec-descent parser of GCC-4.1 is WRONG!!!
- From: Daniel Berlin <dberlin at dberlin dot org>
- To: jc-nospam at jr-pizarro dot jazztel dot es
- Cc: gcc at gcc dot gnu dot org
- Date: Wed, 16 Mar 2005 08:37:53 -0500
- Subject: Re: Hand-written rec-descent parser of GCC-4.1 is WRONG!!!
- References: <1110949748.4237bf74907bd@webmail.jazznet.es>
On Wed, 2005-03-16 at 06:09 +0100, jc-nospam@jr-pizarro.jazztel.es
wrote:
> | > It's possible that C++ doesn't require unbounded lookahead
> |
> | No, it's not.
> | In fact, if you'd read the language grammar definition, you'd discover
> | you could pretty produce the anti-program with some work.
> | That given any k, it produces a C++ program that cannot be parsed with
> | an LR(k) parser.
> |
> | Unless you are going to refute that this is possible (and it has been
> | done before, so trying to refute it would just make you look sily), this
> | proves that C++ is not an LR(k) language.
>
> Then the final solution with better compilation space-time and valid grammar
> is to kill the evil standard C++ and to make a new standard D++ compatible
> with LALR(1) or LL(1) languages.
> (e.g. as Delphi or Object Pascal but using the C/C++-like style)
>
We'll get right on that.