This thesis argues the need for good syntax error handling schemes in language\ud translation systems such as compilers, and for the automatic incorporation of such schemes\ud into parser-generators. Syntax errors are studied in a theoretical framework and practical\ud methods for handling syntax errors are presented.\ud The theoretical framework consists of a model for syntax errors based on the concept of\ud a minimum prefix-defined error correction,a sentence obtainable from an erroneous string by\ud performing edit operations at prefix-defined (parser defined) errors. It is shown that for an\ud arbitrary context-free language, it is undecidable whether a better than arbitrary choice of edit\ud operations can be made at a prefix-defined error. For common programming languages,it is\ud shown that minimum-distance errors and prefix-defined errors do not necessarily coincide,\ud and that there exists an infinite number of programs that differ in a single symbol only; sets\ud of equivalent insertions are exhibited.\ud Two methods for syntax error recovery are, presented. The methods are language\ud independent and suitable for automatic generation. The first method consists of two stages,\ud local repair followed if necessary by phrase-level repair. The second method consists of a\ud single stage in which a locally minimum-distance repair is computed. Both methods are\ud developed for use in the practical LR parser-generator yacc, requiring no additional\ud specifications from the user. A scheme for the automatic generation of diagnostic messages\ud in terms of the source input is presented. Performance of the methods in practice is evaluated\ud using a formal method based on minimum-distance and prefix-defined error correction. The\ud methods compare favourably with existing methods for error recovery
To submit an update or takedown request for this paper, please submit an Update/Correction/Removal Request.