Newsgroups: comp.lang.smalltalk
Path: cantaloupe.srv.cs.cmu.edu!rochester!udel!news.mathworks.com!newsfeed.internetmci.com!howland.reston.ans.net!torn!nott!cunews!dbuck
From: dbuck@superior.carleton.ca (Dave Buck)
Subject: Re: Grammar of Smalltalk
X-Nntp-Posting-Host: superior.carleton.ca
Message-ID: <DJw1ut.yA@cunews.carleton.ca>
Sender: news@cunews.carleton.ca (News Administrator)
Organization: Carleton University, Ottawa, Canada
References: <4aruoe$1ee@zdi.informatik.uni-stuttgart.de> <DJnuIG.L0L@cunews.carleton.ca> <30D5B71B.423F@bridge.bellsouth.com> <1995Dec19.224409.20441@slc.com>
Date: Wed, 20 Dec 1995 14:06:29 GMT
Lines: 37

In article <1995Dec19.224409.20441@slc.com>,
Alan Darlington <aland@servio.slc.com> wrote:
>Faisal Waris <faisal.waris@bridge.bellsouth.com> writes:
><snip> 
>> My Compiler Construction book says "a necessary condition for
>> a recursive-descent compiler to operate correctly is that its source
>> grammar be LL(1)." (Bates, et. al.)
>> 
>> Regards
>> 
>> Faisal
>
>The key word is "correctly"...
>
>I once investigated recursive-descent OS command line processor which
>turned out to have a LL(4) grammar.  Needless to say, it wasn't
>implemented that way.  Oops...  :-)

Right.  Just to be clear, a compiler is built based on a grammar and
the language can be described by many different grammars so you can
use any of them to build a compiler.  The LL grammars LL(k) can be
parsed by a recursive descent parser.  It's also possible to transform
all LL(k) grammars into an equivalent LL(1) grammar.  The VisualWorks
compiler is built on an LL(k) grammar because it takes advantage of
look ahead from time to time.

David Buck
dbuck@ccs.carleton.ca

_________________________________
| David K. Buck                 |
| dbuck@ccs.carleton.ca         |
| The Object People             |
|_______________________________|



