|Re. Is PASCAL LL/LR sankar@Neon.Stanford.EDU (1990-10-26)|
|Re: Re. Is PASCAL LL/LR firstname.lastname@example.org (1990-10-29)|
|From:||email@example.com (Piet van Oostrum)|
|In-Reply-To:||sankar@Neon.Stanford.EDU (Sriram Sankar)|
|Keywords:||Pascal, parse, LL(1)|
|Organization:||Dept of Computer Science, Utrecht University, The Netherlands|
|Date:||29 Oct 90 14:47:25 GMT|
>>>>> In article <1990Oct26.213044.28243@Neon.Stanford.EDU>, sankar@Neon.Stanford.EDU (Sriram Sankar) (SS) writes:
SS> Since PASCAL has a rule that dangling else's associate with the
SS> innermost 'if', it seems obvious to me that PASCAL (at least wrt to the
SS> if statement) is LR. If the dangling else was associated with the
SS> outermost 'if' you can still make the necessary S/R decisions, so I do
SS> think (not looked at it carefully enough though) that this too is LR.
It is even very easy to rewrite the grammar to be LR(1). Someone did that a
few postings ago. See also the dragon book , p. 175
The dragon book also states that it is impossible to change the
if-then-else grammar to an equivalent one that is LL(1) (page 192). I have
not seen a proof of this, so I accept this by faith.
 Aho, Sethi and Ullman, Compilers, Principles, Techniques and Tools,
Piet* van Oostrum, Dept of Computer Science, Utrecht University,
Padualaan 14, P.O. Box 80.089, 3508 TB Utrecht, The Netherlands.
Telephone: +31 30 531806 Uucp: uunet!mcsun!ruuinf!piet
Telefax: +31 30 513791 Internet: firstname.lastname@example.org (*`Pete')
Return to the
Search the comp.compilers archives again.