|recursive parsers and FOLLOW sets email@example.com (KB Sriram) (1996-03-20)|
|Re: recursive parsers and FOLLOW sets firstname.lastname@example.org (1996-03-22)|
|Re: recursive parsers and FOLLOW sets email@example.com (1996-03-22)|
|From:||firstname.lastname@example.org (M.M. van der Laan)|
|Date:||22 Mar 1996 00:44:31 -0500|
KB Sriram <email@example.com> writes:
>When generating recursive descent parsers from LL(1) grammars, are
>FOLLOW sets needed for anything other than detecting syntax errors
>"quicker" and error repair/recovery?
I absolutely agree. Everyone who ever wrote a recursive descent parser
by hand probably didn't consider the follow set at all. I never saw
any reasons to use it.
In my opinion parser-generator theory is too heavily mixed with
grammar theory. Grammars are about GENERATING a text, while parsers
for RECOGNISING it. The goals are entirely different.
Advantages of leaving out FOLLOW sets are:
- the 'dangling-else' problem simply disappears
- tables become much shorter
- the grammar is much simpeler to write
Off course, there is one drawback: every grammar rule can have at most
one (possibly) empty production. But I don't see any problems in that.
By the way, for my own programming language I will build a custom
parser-generator shortly. It won't use FOLLOW sets. It will also allow
the programmer to extend the grammar in the programs' source. Is
anyone interested in co-operating on this?
Mauk van der Laan
Return to the
Search the comp.compilers archives again.