Error recovery for YACC parsers

Julia Anne Dain · Warwick Research Archive Portal (University of Warwick) · 1985

The aim to improve error recovery in parsers generated by the LALR parser-generator Yacc. We describe an error recovery scheme which a new version of Yacc automatically builds into its parsers. The scheme uses state information to attempt to repair input which is syntactically incorrect. Repair by alteration of a single token is attempted first, followed by replacement of a phrase of the input. A parser for the C language is generated from existing specifications and tested on a collection of student programs. The quality of error recovery and diagnostic messages is found to be higher than that of the existing portable C compiler. The new version of Yacc may be used by any current user Yacc, with minor modifications to their existing specifications, to produce systems with enhanced syntax error recovery.

Read the paper · More papers on PaperTik