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

firth@sei.cmu.edu (Robert Firth)
5 Nov 90 14:34:03 GMT

          From comp.compilers

Related articles
[11 earlier articles]
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)
Re: Can Pascal be parsed by LR(1) parsing algorithm? piet@cs.ruu.nl (1990-10-26)
Re: Can Pascal be parsed by LR(1) parsing algorithm? andy@Theory.Stanford.EDU (1990-10-26)
Re: Can Pascal be parsed by LR(1) parsing algorithm? jas@Ingres.COM (1990-10-28)
Re: Can Pascal be parsed by LR(1) parsing algorithm? firth@sei.cmu.edu (1990-11-05)
| List of all articles for this month |
Newsgroups: comp.compilers
From: firth@sei.cmu.edu (Robert Firth)
Keywords: Pascal, parse, LR(1)
Organization: Software Engineering Institute, Pittsburgh, PA
References: <9112@fy.sei.cmu.edu) <14251@goofy.megatest.UUCP>
Date: 5 Nov 90 14:34:03 GMT

In article <14251@goofy.megatest.UUCP> djones@megatest.uucp (Dave Jones) writes:


> case fruit of
> apple: pear: x := 1;
>
>is not legal.


Please check the syntax in Wirth's paper, section 9.2.2.2.


It reads:


case-list-element ::= {case-label :}+ statement | {case-label :}+


In other words, each case arm can be introduced by several case labels,
all of which of course can be identifiers.


> Just for the fun of it, here's the error barrage that
>the Berkeley Pascal compiler produces:


You mean you believe what a Berkeley compiler tells you? You wouldn't
happen to be needing a bridge, would you?


>P.s. "Labeled" has only two l's.


Sigh.
--


Post a followup to this message

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