Path: utzoo!attcan!uunet!world!esegue!compilers-sender From: firth@sei.cmu.edu (Robert Firth) Newsgroups: comp.compilers Subject: Re: Can Pascal be parsed by LR(1) parsing algorithm? Keywords: Pascal, parse, LR(1) Message-ID: <9372@fy.sei.cmu.edu> Date: 5 Nov 90 14:34:03 GMT References: <9112@fy.sei.cmu.edu) <14251@goofy.megatest.UUCP> Sender: compilers-sender@iecc.cambridge.ma.us Reply-To: firth@sei.cmu.edu (Robert Firth) Organization: Software Engineering Institute, Pittsburgh, PA Lines: 28 Approved: compilers@esegue.segue.boston.ma.us 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. -- Send compilers articles to compilers@esegue.segue.boston.ma.us {ima | spdcc | world}!esegue. Meta-mail to compilers-request@esegue.