Re: simple vs. complex parsers

Antti-Juhani Kaijanaho <antkaij@mit.jyu.fi>
24 May 2003 16:58:30 -0400

          From comp.compilers

Related articles
[12 earlier articles]
Re: simple vs. complex parsers cfc@shell01.TheWorld.com (Chris F Clark) (2003-05-18)
Re: simple vs. complex parsers schmitz@essi.fr (Sylvain Schmitz) (2003-05-18)
Re: simple vs. complex parsers mal@wyrd.be (Lieven Marchand) (2003-05-18)
Re: simple vs. complex parsers bs@research.att.com (2003-05-18)
Re: simple vs. complex parsers nmm1@cus.cam.ac.uk (2003-05-23)
Re: simple vs. complex parsers bs@research.att.com (2003-05-23)
Re: simple vs. complex parsers antkaij@mit.jyu.fi (Antti-Juhani Kaijanaho) (2003-05-24)
| List of all articles for this month |

From: Antti-Juhani Kaijanaho <antkaij@mit.jyu.fi>
Newsgroups: comp.compilers
Date: 24 May 2003 16:58:30 -0400
Organization: University of Jyvaskyla, Finland
References: 03-02-125 03-02-147 03-03-043 03-03-061 03-03-103 03-04-006 03-04-028 03-04-046 03-04-066 03-04-116 03-05-103
Keywords: parse, design
Posted-Date: 24 May 2003 16:58:30 EDT

Robert A Duff wrote:
> TeX is one of the worst programming languages I have ever seen.
> I'm amazed that someone as brilliant as Knuth can be so bad at
> language design.


ISTR reading a Knuth interview (probably in an early-90's Tugboat) where
he said that he was trying to resist making TeX a programming language
and for that reason made the choices he made. Then, after user
reguests, he added a feature, and then another, and another, and so on,
until it was a programming language - a horrible one at that.


> Lisp suffers from the many-dialect problem. But that's a somewhat
> different issue, I think. Each of those dialects has a *very* simple
> syntax, compared to most languages.


That's because Lisp uses a minimal concrete syntax to express its
abstract syntax. Many languages have abstract syntaxes (at least as
represented in AST's of some compilers), but they tend to use a more
elaborate concrete syntax, one intended to look more or less familiar.


> To me, recursive descent is intuitively obvious. [...]
> LR parsing, however, is something of a mystery to me. I *sort of*
> understand how it works, but slogging through those tables is a
> nightmare.


In my experience, recursive descent parsers are easier to understand
than LARL parsers, but LARL grammars are easier to work with than
grammars intended for predictive (recursive descent) parsing. So I
tend to use generated LARL parsers whenever the grammar consists of
more than a handful of productions.


--
Antti-Juhani Kaijanaho, FM (MSc), http://www.mit.jyu.fi/antkaij/
ohjelmistotekniikan assistentti * assistant in software engineering
Jyväskylän yliopisto * University of Jyväskylä
Tietotekniikan laitos * Dept. of Mathematical Inf. Tech.


Post a followup to this message

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