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 that don't look like C). > > | > > > | > Why don't we develop a "LR(k) / k small" functions-written parser for > > this > > | > complex grammar? > > | > > | Because C++ is not LR(k) for any k. It really does require unbounded > > | lookahead. > > > > 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.
s/C++ program/grammatically valid C++ program/, just so we are clear.