Re: Writing a recursive descent parser in C

SLK Parsing <dr_feriozi@prodigy.net>
7 Dec 2001 23:43:24 -0500

          From comp.compilers

Related articles
Writing a recursive descent parser in C bilbo@volcanomail.com (2001-11-29)
Re: Writing a recursive descent parser in C spinoza1111@yahoo.com (2001-12-03)
Re: Writing a recursive descent parser in C joachim_d@gmx.de (Joachim Durchholz) (2001-12-07)
Re: Writing a recursive descent parser in C lingolanguage@hotmail.com (Bill Rayer) (2001-12-07)
Re: Writing a recursive descent parser in C dr_feriozi@prodigy.net (SLK Parsing) (2001-12-07)
Re: Writing a recursive descent parser in C alexc@world.std.com (2001-12-11)
Re: Writing a recursive descent parser in C spinoza1111@yahoo.com (2001-12-11)
| List of all articles for this month |
From: SLK Parsing <dr_feriozi@prodigy.net>
Newsgroups: comp.compilers
Date: 7 Dec 2001 23:43:24 -0500
Organization: Prodigy Internet http://www.prodigy.com
References: 01-11-146 01-12-008
Keywords: parse, LL(1)
Posted-Date: 07 Dec 2001 23:43:24 EST

This detailed description of how to construct a recursive descent
compiler is a good argument for using a parser generator. The amount
of hand coding that is essentially just trivial bookkeeping is
staggering. A table-driven top-down parser generator like SLK handles
the parsing details, freeing the programmer to concentrate on code
generation. The table-driven aspect means in part that the recursion
is implemented explicitly using a stack, rather than by using the
recursive feature of a programming language. Since it is top-down, the
flow is the same as recursive descent, so easily understood. SLK has
automatic detection of terminals, and other features that make it easy
to learn to use. Basically just write the BNF grammar in almost any
commonly used syntactic format, debug it, and then begin inserting
semantic actions to start generating code. (After writing the scanner
and symbol table manager.)


Note that SLK supports full backtracking under fine grained programmer
control. Actions are not excecuted during this process, so there is no
need to worry about backing out.


Both commercial and shareware versions of SLK are available at
http://pages.prodigy.net/dr_feriozi. Recursive descent programmers are
welcome to use SLK to validate their grammar.


Post a followup to this message

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