home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!munnari.oz.au!yoyo.aarnet.edu.au!news.adelaide.edu.au!cs.adelaide.edu.au!andrewd
- From: andrewd@cs.adelaide.edu.au (Andrew Dunstan)
- Newsgroups: comp.lang.ada
- Subject: Re: GNU-NYU Ada project
- Date: 23 Nov 1992 00:12:21 GMT
- Organization: The University of Adelaide
- Lines: 40
- Distribution: world
- Message-ID: <1ep7l5INN3kb@huon.itd.adelaide.edu.au>
- References: <1992Nov19.184504.22639@coe.montana.edu> <62223@mimsy.umd.edu>
- NNTP-Posting-Host: achilles.cs.adelaide.edu.au
-
- In article <62223@mimsy.umd.edu>, alex@cs.umd.edu (Alex Blakemore) writes:
- |> dpoole@hydrogen.oscs.montana.edu (David Poole) writes:
- |> [report about NYU GNU Ada Project]
- |> > the parser uses recursive descent.
- |>
-
- I should be very interested to see the parsing grammar being used. I was under the
- impression that Ada was difficult to do using LL(k) methods. Since I like both
- Ada and LL parsing, I am glad to see that the two are getting married :-)
-
-
- |> [discussion of relative merits of LL(1) and LALR(1) parsing]
- ...
- |>
- |> LALR(1) is a very popular class of grammar because it includes a large class
- |> of languages and there are efficient techniques/tools for automatically constructing
- |> parsers for LALR(1) grammars. It is not the _best possible_ assuming you mean
- |> can parse the largest class of grammars. I believe there exist languages for which
- |> there exist LR(1) grammars but not LALR(1) grammars for example. Recursive descent
- |> works for the class LL(1) which is smaller than LALR(1).
-
- This is not quite correct. (This discussion really belongs in comp.compilers.)
- The class LL(1) is smaller than the class LALR(1). In fact, the class LL(k) is
- smaller than the class LALR(1) for any k. However. the class LALR(1) = LR(1). This
- class actually also includes SLR(1). This class can be shown to be the class of all
- determinstically parseable languages. In fact, you can produce an SLR(1) or LALR(1)
- grammar which not only derives the same language as any LR(k) grammar, but the parser
- for which emits the same set of parse traces as a parser built from the original grammar.
- In effect, this means that it builds an equivalent parse tree. If the language is prefix-free,
- you can even build an LR(0) covering grammar for it. The reason for not doing this is
- not that it can't be done, but that it is simply not worth the trouble, normally.
-
- --
- #######################################################################
- # Andrew Dunstan # There's nothing good or bad #
- # Department of Computer Science # but thinking makes it so. #
- # University of Adelaide # #
- # South Australia # - Shakespeare #
- # net: andrewd@cs.adelaide.edu.au # #
- #######################################################################
-