Sam Tregar <sam@tregar.com> writes: >On Sun, 23 Jul 2000, Nick Ing-Simmons wrote: > >> I think that a (non absolute) goal of perl6's grammar should be that it >> is a near to yacc/byacc/bison/yapp LALR(1) as is possible without quite so >> much hackery in the lexer. Some hackery in the lexer is not uncommon >> even in "pure" yacc languages (even C needs to notice typedefs), but perl5 >> has gone too far. > >Does that mean you think a rewite could yeild support for perl5's >"flexible" grammer in a better way, There is superficially (it is the details that hurt and I don't know them all) _some_ scope for cleaning up perl5's grammar. >or that you think the grammar should >be simplified to make it easier to parse? One of the BIG things in perl6 is that we think we can handle backward compatibility by translation, so the grammar is "up for grabs" - it should be cleaned up - Larry has said it will be "a lot more consistent". I think we should strive to make it LALR(1) even if (as seems inevitable) it remains fairly complex. I think the grammar will remain fairly complex - to keep the language understandable. One of my pet hates about Tcl is that while the surface grammar is near trivial (lists of "words") this means that all the "sense" is below the surface. So for perl6 there is a balance to be struck between easy to parse, semantically clean , natural for humans, ... . P.S. (The other BIG thing is that we can re-do internals to be more efficient and get some of the speed back.) -- Nick Ing-SimmonsThread Previous | Thread Next