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

firth@sei.cmu.edu (Robert Firth)
17 Oct 90 19:10:36 GMT

          From comp.compilers

Related articles
[4 earlier articles]
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)
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)
[1 later articles]
| List of all articles for this month |

Newsgroups: comp.compilers
From: firth@sei.cmu.edu (Robert Firth)
Keywords: pascal, parse
Organization: Software Engineering Institute, Pittsburgh, PA
References: <9010091533.AA02386@apple.com> <1990Oct10.133752.14930@ncsuvx.ncsu.edu>
Date: 17 Oct 90 19:10:36 GMT

In article <1990Oct10.133752.14930@ncsuvx.ncsu.edu> mauney@eos.ncsu.edu (Jon Mauney) writes:


>Berkeley Pascal was, for some time, unable to accept a null
>statement in the "then" clause:
>
> if i<0 then else foo(i);


But that is not legal Pascal. The relevant syntax (Wirth, section 9.2.2.1)
reads
<if-statement> ::= IF <expression> THEN <statement> |
IF <expression> THEN <statement> ELSE <statement>


and there is no production from <statement> that yields <empty>.
--


Post a followup to this message

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