|Parsing techniques firstname.lastname@example.org (1993-05-04)|
|Re: Parsing techniques email@example.com (1993-05-07)|
|Re: Parsing techniques firstname.lastname@example.org (1993-05-08)|
|Parsing techniques email@example.com (Kent Rollins) (1996-11-26)|
|Re: Parsing techniques firstname.lastname@example.org (Scott Stanchfield) (1996-12-01)|
|Re: Parsing techniques email@example.com (1996-12-01)|
|Re: Parsing techniques firstname.lastname@example.org (1996-12-01)|
|Re: Parsing techniques email@example.com (1996-12-01)|
|Re: Parsing techniques firstname.lastname@example.org (1996-12-03)|
|Re: Parsing techniques email@example.com (Ron House) (1996-12-07)|
|Re: Parsing techniques firstname.lastname@example.org (1996-12-09)|
|Re: Parsing techniques parrt@MageLang.com (Terence Parr) (1996-12-09)|
|[2 later articles]|
|Date:||1 Dec 1996 22:52:42 -0500|
|Organization:||Mauney Computer Consulting|
|Keywords:||parse, C++, LL(1), LALR|
Kent Rollins <email@example.com> writes:
>... Most of the literature I have read seems to imply that
>LL(k) grammars are only for small/simple languages and that LR
>grammars must be used for thicker languages like C++.
>... Can C++ successfully be parsed with an LL(k) grammar? If
Having written both LL and LR parser generators, and both LL and LR
parsers using those and several other tools, let me give my take:
If you're trying to actually get something accomplished, the quality
of the specific tool is more important than the theoretical properties
of the parsing algorithm. You want a generator that automates as much
grunt work as possible, while giving you flexibility at the same time.
There's a lot more to that than just computing state machnes and
Good parser generators go well beyond what the clean theoretical model
implies. The dangling-else construct of C is theoretically impossible
for LL parsers, but LL parser generators typically handle it anyway.
The correct LR grammar for C's if-then-else is a pain in the butt, but
LR generators accept the more convenient form and handle it properly.
I maintain that syntax error handling is far easier in LL, in theory,
but the real question is how well the tool does it, not how well the
published research articles do it. Ugly languages like C++ require so
many compromises that you will quickly forget what the parsing
algorithm is anyway.
If you want to parse C++, you'll get a lot farther starting with PCCTS
than with yacc.
Jon Mauney firstname.lastname@example.org
Mauney Computer Consulting (919) 828-8053
Return to the
Search the comp.compilers archives again.