Re: Hand-written rec-descent parser of GCC-4.1 is WRONG!!!

2005-03-23 Thread jc-nospam
> The best option is a clean and maintainable parser. Whether it uses a > parser generator or not is comparatively academic... Many years later ... Clean is good for our health, dirty is bad for our health. > -- > This is like system("/usr/funky/bin/perl -e 'exec sleep 1'"); >--- Peter da S

Re: Hand-written rec-descent parser of GCC-4.1 is WRONG!!!.

2005-03-22 Thread Nix
On 16 Mar 2005, Joe Buck stated: > On Wed, Mar 16, 2005 at 02:41:12AM +0100, [EMAIL PROTECTED] wrote: >> Writing Hand-written recursive-descent parser miss-cleans the source code >> and goes hardfully to maintain it!!! > > Not if you know how to write one correctly. ... and I must say that Mark's

Re: Hand-written rec-descent parser of GCC-4.1 is WRONG!!!

2005-03-16 Thread Daniel Berlin
On Wed, 2005-03-16 at 06:09 +0100, [EMAIL PROTECTED] 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

RE: Hand-written rec-descent parser of GCC-4.1 is WRONG!!!

2005-03-15 Thread Gary Funck
The following paper provides some background on the difficulties encountered with parsing C++: http://citeseer.ist.psu.edu/irwin01generated.html Abstract: C++ is an extraordinarily difficult programming language to parse. The language cannot readily be approximated with an LL or LR grammar (re

Re: Hand-written rec-descent parser of GCC-4.1 is WRONG!!!

2005-03-15 Thread jc-nospam
| > | > Do you demonstrate that "C++ is not LALR(1)"? | > | | > | I'll leave that to you as a homework assignment. Actually, C++ is not | > | LALR(N) for any N. | | Nor is it LR(N) nor LL(N). | | > | Get out the C++ grammar and figure it out, it's an easy proof. | > | Come back when you have pro

Re: Hand-written rec-descent parser of GCC-4.1 is WRONG!!!

2005-03-15 Thread jc-nospam
| > | > Do you demonstrate that "C++ is not LALR(1)"? | > | | > | I'll leave that to you as a homework assignment. Actually, C++ is not | > | LALR(N) for any N. | | Nor is it LR(N) nor LL(N). | | > | Get out the C++ grammar and figure it out, it's an easy proof. | > | Come back when you have pro

Re: Hand-written rec-descent parser of GCC-4.1 is WRONG!!!

2005-03-15 Thread jc-nospam
| > 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) p

Re: Hand-written rec-descent parser of GCC-4.1 is WRONG!!!

2005-03-15 Thread Zack Weinberg
[EMAIL PROTECTED] writes: > | > Do you demonstrate that "C++ is not LALR(1)"? > | > | I'll leave that to you as a homework assignment. Actually, C++ is not > | LALR(N) for any N. Nor is it LR(N) nor LL(N). > | Get out the C++ grammar and figure it out, it's an easy proof. > | Come back when y

Re: Hand-written rec-descent parser of GCC-4.1 is WRONG!!!

2005-03-15 Thread Daniel Berlin
On Tue, 2005-03-15 at 23:41 -0500, Daniel Berlin wrote: > On Wed, 2005-03-16 at 04:56 +0100, [EMAIL PROTECTED] > > | > | Bison remains a good solution in many cases, especially for languages > > | > | specifically designed to be easy to parse with an LALR parser (that > > is, > > | > | languages

Re: Hand-written rec-descent parser of GCC-4.1 is WRONG!!!

2005-03-15 Thread Daniel Berlin
On Wed, 2005-03-16 at 04:56 +0100, [EMAIL PROTECTED] > | > | Bison remains a good solution in many cases, especially for languages > | > | specifically designed to be easy to parse with an LALR parser (that is, > | > | languages that don't look like C). > | > > | > Why don't we develop a "LR(k) /

Re: Hand-written rec-descent parser of GCC-4.1 is WRONG!!!

2005-03-15 Thread jc-nospam
| > Do you demonstrate that "C++ is not LALR(1)"? | | I'll leave that to you as a homework assignment. Actually, C++ is not | LALR(N) for any N. Get out the C++ grammar and figure it out, it's an | easy proof. Come back when you have proved it to your own satisfaction, | and please refrain from

Re: Hand-written rec-descent parser of GCC-4.1 is WRONG!!!

2005-03-15 Thread Joe Buck
On Wed, Mar 16, 2005 at 03:22:26AM +0100, [EMAIL PROTECTED] wrote: > Do you demonstrate that "C++ is not LALR(1)"? I'll leave that to you as a homework assignment. Actually, C++ is not LALR(N) for any N. Get out the C++ grammar and figure it out, it's an easy proof. Come back when you have prov

Re: Hand-written rec-descent parser of GCC-4.1 is WRONG!!!

2005-03-15 Thread jc-nospam
| > > http://gcc.gnu.org/gcc-4.1/changes.html | > > | > > New Languages and Language specific improvements | > > C and Objective-C | > > | > > * The old Bison-based C and Objective-C parser has been replaced | > > by a new, faster hand-written recursive-descent parser. | > | > Hahahahaha, W

Re: Hand-written rec-descent parser of GCC-4.1 is WRONG!!!.

2005-03-15 Thread Richard Kenner
> The best option is a clean grammar in Yacc/Bison!. GCC had such parsers for over a decade, and yet they are being replaced. Bison remains a good solution in many cases, especially for languages specifically designed to be easy to parse with an LALR parser (that is, languages

Re: Hand-written rec-descent parser of GCC-4.1 is WRONG!!!.

2005-03-15 Thread Joe Buck
On Wed, Mar 16, 2005 at 02:41:12AM +0100, [EMAIL PROTECTED] wrote: > > http://gcc.gnu.org/gcc-4.1/changes.html > > > > New Languages and Language specific improvements > > C and Objective-C > > > > * The old Bison-based C and Objective-C parser has been replaced > > by a new, faster hand-wri

Hand-written rec-descent parser of GCC-4.1 is WRONG!!!.

2005-03-15 Thread jc-nospam
> http://gcc.gnu.org/gcc-4.1/changes.html > > New Languages and Language specific improvements > C and Objective-C > > * The old Bison-based C and Objective-C parser has been replaced > by a new, faster hand-written recursive-descent parser. Hahahahaha, WRONG!! It's one historical error