6533b7ddfe1ef96bd1273d12

RESEARCH PRODUCT

Syntax Error Handling

Eljas Soisalon-soininenSeppo Sippu

subject

PhraseParsingComputer sciencemedia_common.quotation_subjectComputationAmbiguitycomputer.software_genreTransformation (function)Quality (business)Syntax errorError detection and correctionAlgorithmcomputermedia_common

description

In the previous chapters we have seen that the various parsers discussed, at least whenever they are deterministic, detect an error in any nonsentence. This means, that on any nonsentence there is a computation ending with an error configuration. For practical parsers, mere error detection is not enough; the parser should also emit a meaningful error message and recover from the error. A recovery means that the error configuration is transformed into a non-error configuration at which normal parsing can be resumed. Moreover, the transformation should be done so that as few input symbols as possible will be discarded. The goal of the error recovery is to maximize the amount of input text that can be handled in normal parsing mode and thus to detect as many errors as possible. On the other hand, the error recovery should be designed so that as few extraneous messages as possible will be emitted: only actual errors should be reported. Unfortunately, these goals are often contradictory: being able to detect and report many errors will often cause many extraneous error messages, and few extraneous error messages may imply undetected errors. Also it should be noted that a formal analysis of the quality of an error recovery method is difficult, if not impossible, because of the obvious ambiguity in the meaning of the phrase “actual error”.

https://doi.org/10.1007/978-3-662-08424-3_4