A Syntax-Error-Handling Technique and Its Experimental Analysis
Abstract
A syntax-error-handling technique is defined as an extension of LR parsing.The technique is automatic, and the generation of the error-handling algorithm is based only on the context-free grammar and the lexical description of the language.The heart of the algorithm is a "phrase-lever' error-recovery strategy, which is an improvement upon the basic strategy of Leinius.The notion of phrase-level recovery is further generalized such that "local correction" is included within the basic framework.Special attention is paid to diagnostic aspects, such as the generation of descriptive recovery-independent error messages.The technique has been implemented in the compiler-writing system HLP (Helsinki Language Processor).Promising experimental results have been obtained by testing the technique with erroneous student-written ALGOL and Pascal programs.