Parsers are easy to write (was: Re: Backtracking yacc)

markh@csd4.csd.uwm.edu (Mark)
Fri, 25 Sep 1992 22:20:19 GMT

          From comp.compilers

Related articles
Backtracking yacc jarmo@ksvltd.FI (Jarmo Raiha) (1992-09-10)
Re: Backtracking yacc andrewd@cs.adelaide.edu.au (1992-09-25)
Parsers are easy to write (was: Re: Backtracking yacc) markh@csd4.csd.uwm.edu (1992-09-25)
Quantum Parsing (was: Re: Parsers are easy to write) markh@csd4.csd.uwm.edu (1992-09-28)
Re: Quantum Parsing (was: Re: Parsers are easy to write) dak@kaa.informatik.rwth-aachen.de (1992-09-30)
Re: Quantum Parsing (was: Re: Parsers are easy to write) markh@csd4.csd.uwm.edu (1992-10-03)
| List of all articles for this month |
Newsgroups: comp.compilers
From: markh@csd4.csd.uwm.edu (Mark)
Organization: Computing Services Division, University of Wisconsin - Milwaukee
Date: Fri, 25 Sep 1992 22:20:19 GMT
Keywords: parse, LL(1), errors, yacc, comment
References: 92-09-059 92-09-174

andrewd@cs.adelaide.edu.au (Andrew Dunstan) writes:
>There are other reasons - LL parsers are easy to hand craft, making them
>good for teaching purposes (yes, I know we all use calculators, but we
>also have to know how to do arithmetic without them.) They can also be
>very fast.


All deterministic Context Free Grammars (and many of the non-deterministic
ones too) are easy to craft by hand.


In fact, I challenge anyone to find me one that I cannot craft a parser
for by hand in a short time ("short" meaning: less time than it takes to
write and debug an equivalent YACC source). Something like C is okay,
though it's not deterministic. But C's syntax is too easy, the operative
word here is Challenge.


Any takers?
[Don't forget to make sure that your hand-written parser diagnoses all invalid
input, as a yacc parser does. My experience is that the biggest wins from
using yacc are the automatic diagnosis of ambiguous grammars and the extreme
ease of adding little tweaks later on. -John]
--


Post a followup to this message

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