Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!think.com!mintaka!spdcc!iecc!compilers-sender From: julia@cs.warwick.ac.uk (Julia Dain) Newsgroups: comp.compilers Subject: Parser error detection and recovery Keywords: parse, LR, errors, yacc Message-ID: <974.9104101309@dove.warwick.ac.uk> Date: 10 Apr 91 13:09:33 GMT References: <9103211951.AA01615@fiu.edu> Sender: compilers-sender@iecc.cambridge.ma.us Reply-To: Julia Dain Organization: Compilers Central Lines: 36 Approved: compilers@iecc.cambridge.ma.us This is another response to the request by Vincent George for information on error recovery in LR parser generators. Sorry it is rather late, I have not been able to read news for a few weeks. My PhD thesis `Automatic Error Recovery for LR Parsers in Theory and Practice' (University of Warwick, Coventry, UK, 1990) contains descriptions of 2 methods for automatic error recovery. These are not based on error productions. Both were implemented for yacc and used to build several different parsers, including for C and Pascal, which were tested on collections of student C and Pascal programs. The first method attempts a single token change to the input first; if this "failed" (criterion was, could the parser accept N more tokens, where N was parameterized for different versions) a phrase-level recovery based on replacement of input by a goal non-terminal takes place. The second method is based on the concept of minimum distance - it constructs several possible repairs, from the state information at point of detection of error, and chooses the one at minimum distance from the actual input. As John Levine mentioned, there has been a lot of stuff published in this area. Other error recovery schemes which have been incorporated into parser generators have been described by Roehrich; Fischer, Milton and Quiring; Anderson and Backhouse; Sippu and Soisalon-Soininen; Spenke et al; Boullier and Jourdan; Gray; Koskimies et al. I have got a large bibliography on syntax error handling for LR parsers if anyone is interested. I have also written a survey article (submitted for publication...) -- Julia Dain, Dept Computer Science, University of Warwick, Coventry CV4 7AL, UK julia@cs.warwick.ac.uk Phone +44 203 523364 Fax +44 203 525714 -- Send compilers articles to compilers@iecc.cambridge.ma.us or {ima | spdcc | world}!iecc!compilers. Meta-mail to compilers-request.