Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!yale!mintaka!spdcc!ima!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 Message-ID: <9093@fy.sei.cmu.edu> Date: 17 Oct 90 19:04:57 GMT References: <9010091533.AA02386@apple.com> Sender: compilers-sender@esegue.segue.boston.ma.us Reply-To: firth@sei.cmu.edu (Robert Firth) Organization: Software Engineering Institute, Pittsburgh, PA Lines: 22 Approved: compilers@esegue.segue.boston.ma.us In article <9010091533.AA02386@apple.com> A. Michael Burbidge writes: >After struggling for some time to write a yacc description for the >Pascal language and after reading the description of the modifier yacc >contained in the UCB Pascal source directory I am beginning to wonder >if an LR(1) parsing algorithm can parse Pascal. The version of yacc >used with the UCB Pascal claims to have additional lookahead sets. Can >anyone shead any light on this subject. The optional semi-colons seem >to be very difficult to deal with. Many moons ago, I wrote a front end for Pascal, and don't recall having any trouble except the dear old stupid "1.5" versus "1..5", which needs a two-character lookahead in the lexer. Moreover, I've just checked both Wirth's original paper and a couple of books on Pascal, and can't find ANY optional semicolons in the grammar. If you could post a little more detail, I'll try to be more helpful! -- Send compilers articles to compilers@esegue.segue.boston.ma.us {ima | spdcc | world}!esegue. Meta-mail to compilers-request@esegue.