Re: Can Pascal be parsed by LR(1) parsing algorithm?

lindsay@comp.vuw.ac.nz (Lindsay Groves)
Tue, 16 Oct 90 01:55:24 GMT

          From comp.compilers

Related articles
Can Pascal be parsed by LR(1) parsing algorithm? amb@apple.com (A. Michael Burbidge) (1990-10-09)
Re: Can Pascal be parsed by LR(1) parsing algorithm? mauney@eos.ncsu.edu (1990-10-10)
Re: Can Pascal be parsed by LR(1) parsing algorithm? hankd@dynamo.ecn.purdue.edu (1990-10-10)
Re: Can Pascal be parsed by LR(1) parsing algorithm? joel@decwrl.dec.com (1990-10-15)
Can Pascal be parsed by LR(1) parsing algorithm? meissner@osf.org (1990-10-10)
Re: Can Pascal be parsed by LR(1) parsing algorithm? KARSTEN@tfl.dk (Karsten Nyblad, TFL, Denmark) (1990-10-10)
Re: Can Pascal be parsed by LR(1) parsing algorithm? bliss@sp64.csrd.uiuc.edu (1990-10-10)
Re: Can Pascal be parsed by LR(1) parsing algorithm? lindsay@comp.vuw.ac.nz (1990-10-16)
Re: Can Pascal be parsed by LR(1) parsing algorithm? rekers@cwi.nl (1990-10-16)
Re: Can Pascal be parsed by LR(1) parsing algorithm? firth@sei.cmu.edu (1990-10-17)
Re: Can Pascal be parsed by LR(1) parsing algorithm? firth@sei.cmu.edu (1990-10-17)
Re: Can Pascal be parsed by LR(1) parsing algorithm? firth@sei.cmu.edu (1990-10-18)
Re: Can Pascal be parsed by LR(1) parsing algorithm? djones@megatest.uucp (1990-10-21)
Re: Can Pascal be parsed by LR(1) parsing algorithm? crocker@Alliant.COM (1990-10-23)
[4 later articles]
| List of all articles for this month |

Newsgroups: comp.compilers
From: lindsay@comp.vuw.ac.nz (Lindsay Groves)
Keywords: pascal, parse
Organization: Computer Science Dept, Victoria University, Wellington, NEW ZEALAND
References: <9010091533.AA02386@apple.com> <9010101445.AA06181@dynamo.ecn.purdue.edu>
Date: Tue, 16 Oct 90 01:55:24 GMT

In article <9010101445.AA06181@dynamo.ecn.purdue.edu>,
hankd@dynamo.ecn.purdue.edu (Hank Dietz) writes:
|> Pascal is generally defined using a set of syntax diagrams which, by
|> definition, means the language can be recognized using LL(1).


You must be using a strange definition a syntax diagrams if they can
only describe languages that have LL(1) grammars.


As I understand them, syntax diagrams can generate ALL context free
languages, not just those that are also LL(1); i.e. I can turn any
context free grammar into a set of syntax diagrams and vice versa.


For example, the following syntax diagram describes the language
consisting of all non-empty palindromes of even length over the alphabet
{a, b}. This language is inherently ambiguous (ie cannot be recognised
by a deterministic PDA), so it is definitely not LL(1) (nor LL(k),
LR(k), ...):




                +-------------------------------+
                | ^
                v |
    S ----------> a ---> a --------------+----->|
                      | ^
                      |---> b ---> b ---------->|
                      | |
                      |---> a ---> S ---> a --->|
                      | |
                      +---> b ---> S ---> b --->+




Lindsay
--


Post a followup to this message

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