Re: Recursive Descent Parser

paulyg@clara.net (Paul Groves)
22 Feb 2000 09:26:39 -0500

          From comp.compilers

Related articles
Recursive Descent Parser e8rasmus@etek.chalmers.se (Rasmus Anthin) (2000-01-09)
Re: Recursive Descent Parser world!cfc@uunet.uu.net (Chris F Clark) (2000-01-12)
Re: Recursive Descent Parser biocyn@erols.com (2000-01-25)
Re: Recursive Descent Parser chstapfer@bluewin.ch (Christian Stapfer) (2000-02-10)
Re: Recursive Descent Parser rhyde@shoe-size.com (Randall Hyde) (2000-02-12)
Re: Recursive Descent Parser mklarson@gte.net (Michael Larson) (2000-02-22)
Re: Recursive Descent Parser paulyg@clara.net (2000-02-22)
Re: Recursive Descent Parser world!cfc@uunet.uu.net (Chris F Clark) (2000-02-22)
Re: Recursive Descent Parser fjscipio@rochester.rr.com (Fred J. Scipione) (2000-02-23)
Re: Recursive Descent Parser adrian@dcs.rhbnc.ac.uk (2000-02-27)
Re: Recursive Descent Parser anton@mips.complang.tuwien.ac.at (2000-02-27)
| List of all articles for this month |

From: paulyg@clara.net (Paul Groves)
Newsgroups: comp.compilers
Date: 22 Feb 2000 09:26:39 -0500
Organization: Compilers Central
References: 00-01-027 00-01-032 00-02-034 00-02-058 00-02-111
Keywords: parse

>Hmm... I am wrtting a shading language compiler for Renderman.... I
>have been having some problems with the language and putting various
>work arounds in to fix problems with yacc.... If the language is small
>enough and I am comfortable with recursive routines, should I try the
>recursive decent approach first?
>
>Mike Larson


Give it a go.


Recursive descent parsers aren't difficult to write for small 'proper'
LL1 languages.
One of our tutors at university believed than Lex and Yacc were evil
(seriously) and had us writing parsers for a language called Newt
within 4 weeks. Newt was a Pascal sub-set with only an integer
datatype (to stop us freshmen from throwing ourselves off the nearest
roof when coming to write the symbol table routines).


Looking back, it was a fantastic choice and I think that more
university lecturers should follow Chris' example.


Mind you, stepwise refinement via recursive descent is only really
'nice' when you can use nested procedures/functions ala Pascal.


And I agree with Stroustrup (which is nice :-) ), if you're writing a
langauge as an exeriment - hand writing the parser is the only way to
go.


Paul.


Post a followup to this message

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