Re: LL(1) vs LALR(1) parsers

jgj@ssd.hcsc.com (Jeff Jackson)
Tue, 28 Nov 1995 15:28:20 GMT

          From comp.compilers

Related articles
[3 earlier articles]
Re: LL(1) vs LALR(1) parsers the_tick@access5.digex.net (1995-11-10)
Re: LL(1) vs LALR(1) parsers parrt@lonewolf.parr-research.com (1995-11-14)
Re: LL(1) vs LALR(1) parsers simmons@bnr.ca (steve (s.s.) simmons) (1995-11-15)
Re: LL(1) vs LALR(1) parsers parrt@parr-research.com (Terence John Parr) (1995-11-20)
Re: LL(1) vs LALR(1) parsers bill@amber.ssd.hcsc.com (1995-11-22)
Re: LL(1) vs LALR(1) parsers elliottc@logica.com (1995-11-24)
Re: LL(1) vs LALR(1) parsers jgj@ssd.hcsc.com (1995-11-28)
Re: LL(1) vs LALR(1) parsers will@ccs.neu.edu (1995-11-28)
Re: LL(1) vs LALR(1) parsers ddean@dynastar.cs.princeton.edu (1995-11-28)
Re: LL(1) vs LALR(1) parsers napi@ms.mimos.my (1995-11-28)
Re: LL(1) vs LALR(1) parsers ok@cs.rmit.edu.au (1995-11-29)
Re: LL(1) vs LALR(1) parsers mparks@oz.net (1995-11-29)
Re: LL(1) vs LALR(1) parsers jmccarty@spdmail.spd.dsccc.com (1995-11-29)
[12 later articles]
| List of all articles for this month |

Newsgroups: comp.compilers
From: jgj@ssd.hcsc.com (Jeff Jackson)
Keywords: parse, LL(1)
Organization: I would rather be windsurfing.
References: 95-11-051 95-11-138 95-11-195
Date: Tue, 28 Nov 1995 15:28:20 GMT

>> That is, the automated parsers use a great deal of automata theory
>> which helps build on the computer science foundation. Recursive descent
>> parsers are a small matter of programming (SMOP). I do notice among
>> peers in industry that people are no longer snubbing the idea of writing
>> a recursive parser when it is appropiate.
>
> I've noticed that, too, and I really wonder why.


I think one reason is that people parse with recursive descent w/back
tracking. It just seems more natural (though that doesn't necessarily
mean it's better, for all values of good:-) to parse in recursive
descent. When reading convoluted yacc-like grammars, I always feel
like I'm twisting my brain inside out because its doing everything
backwards from the way I read and write code.


On the other hand, I find the idea of hand coding a recursive descent
parser, or an automata of any sort more trivial than parsing an
integer for that matter, quite repulsive. Recursive descent w/back
tracking can be generated from a grammar and I find such grammars far
easier to read and understand.


On the other hand (all good programmers have three hands, right?), I'm
under the impression, though possibly mistaken as I haven't done a
literature search on the topic, that most theoretical work on error
recovery has been done on LR type parsers.


>> Remember you don't take a compiler course to learn how to build a
>> compiler, surprise... Most people never write a compiler. You take
>> it for the following reasons:
>>
>> - Improving your comp. sci. background to understand
>> automata theory with a very good application.
>
> Many curricula separate automata theory from compilers, and in those cases
> the compiler course assumes you already know automata theory.
>
>> - Understanding what a compiler may do (or not do) for
>> your code.
>> - Learning about big system software, data structures, etc.


Another purpose for compiler classes is not all programs can get their
input data by having the user press an idiot button with a mouse.
Actually parsing, or at least lexically scanning, keyboard input is
done by many programs.
--
Jeffrey Glen Jackson
jgj@ssd.csd.harris.com
--


Post a followup to this message

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