Re: ANNOUNCE: Tiny, a parser generator for context sensitive grammars

"Daniel C. Wang" <danwang+news@cs.princeton.edu>
6 Aug 2001 04:03:52 -0400

          From comp.compilers

Related articles
ANNOUNCE: Tiny, a parser generator for context sensitive grammars maurice@gittens.nl (Maurice Gittens) (2001-07-23)
Re: ANNOUNCE: Tiny, a parser generator for context sensitive gram eodell@c1220335-a.potlnd1.or.home.com (2001-07-27)
Re: ANNOUNCE: Tiny, a parser generator for context sensitive gr maurice@gittens.nl (Maurice Gittens) (2001-08-02)
Re: ANNOUNCE: Tiny, a parser generator for context sensitive grammars danwang+news@cs.princeton.edu (Daniel C. Wang) (2001-08-06)
Re: ANNOUNCE: Tiny, a parser generator for context sensitive gramma mike@dimmick.demon.co.uk (Mike Dimmick) (2001-08-08)
| List of all articles for this month |

From: "Daniel C. Wang" <danwang+news@cs.princeton.edu>
Newsgroups: comp.compilers
Date: 6 Aug 2001 04:03:52 -0400
Organization: Princeton University
References: 01-07-128 01-07-149 01-08-011
Keywords: tools
Posted-Date: 06 Aug 2001 04:03:52 EDT

"Maurice Gittens" <maurice@gittens.nl> writes:
{stuff deleted}
> This is an interesting question. LALR(1) grammars have proven to
> allow the generation of parsers for many languages used in practice.
>
> Is this because we tailor the languages we use to the possibilities of
> parser generators commonly used or is this because LALR(1) grammars
> are some how "good" enough for every day needs.
>
> To say the truth, I don't really now.


{stuff deleted}


C doesn't have a pure LALR(1) grammar because the parser needs to be
aware of what has been typedefed and what hasn't. (i.e. parsing C is
not context free)


C++ sure doesn't either.


Perl (um nope...)


For Pascal and Java? I think the answer is yes here.


On the more academic side... neither Standard ML nor Haskell have
LALR(1) grammars.


In anycase, it seems to me that in practice many languages do not have
LALR(1) grammars. All compilers use various hacks to fit the grammar
used for parsing into a LALR(1) framework and then do semantic
analysis.


So, I think the few languages that do have LALR grammars are the ones
which were designed to have them. Otherwise designers keep the syntax
so brain dead simple (i.e. Scheme, Smalltalk..) that parsing is
trivial, or end up with something that is 90% LALR(1) plus semantic
hacks.


So, I'm all for more powerful parsing techniques.


Post a followup to this message

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