Newsgroups: comp.lang.smalltalk
Path: cantaloupe.srv.cs.cmu.edu!bb3.andrew.cmu.edu!nntp.sei.cmu.edu!cis.ohio-state.edu!math.ohio-state.edu!howland.reston.ans.net!swrinde!newsfeed.internetmci.com!chi-news.cic.net!nntp.coast.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: <DJnuIG.L0L@cunews.carleton.ca>
Keywords: Grammar, LL(1), SLR(1), LALR(1), LR(1)
Sender: news@cunews.carleton.ca (News Administrator)
Organization: Carleton University, Ottawa, Canada
References: <4aruoe$1ee@zdi.informatik.uni-stuttgart.de>
Date: Sat, 16 Dec 1995 03:47:04 GMT
Lines: 30

In article <4aruoe$1ee@zdi.informatik.uni-stuttgart.de>,
li jinhua <li@informatik.uni-stuttgart.de> wrote:
>Hi, Smalltalkers,
>
>   Usually, a context-free grammar contains a start symbol. But
>in some Smaltallk syntax definitions such as one in Goldberg83,89
>or the one of Visualworks 2.0, there is no the so called start
>symbol or program concept. Is Smalltalk a language of LL(1), SLR(1),
>LALR(1), LR(1) or others?

I'm a bit rusty on my compiler theory but...

A language can normally be implemented using different grammars.  In
the case of the Smalltalk compiler in VisualWorks 2.0, I'm not sure if
the grammar is definitely an LL(1) grammar (I'd have to look at all
the production rules to determine this), but I know that the grammar
is parsed by a recursive descent parser and doesn't belong to one of
the LR grammar types.

This doesn't mean that you can't define an LR grammar for Smalltalk
and write a compiler for it.

David Buck
dbuck@ccs.carleton.ca

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