Re: recursive parsers and FOLLOW sets (M.M. van der Laan)
22 Mar 1996 00:44:31 -0500

          From comp.compilers

Related articles
recursive parsers and FOLLOW sets (KB Sriram) (1996-03-20)
Re: recursive parsers and FOLLOW sets (1996-03-22)
Re: recursive parsers and FOLLOW sets (1996-03-22)
| List of all articles for this month |

From: (M.M. van der Laan)
Newsgroups: comp.compilers
Date: 22 Mar 1996 00:44:31 -0500
Organization: Euronet Internet
References: 96-03-127
Keywords: LL(1)

KB Sriram <> 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

Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.