A modification to Earley's algorithm for syntax error recovery
Date
1988
Authors
Hagglund, Dale
Journal Title
Journal ISSN
Volume Title
Publisher
Abstract
The problem of syntax error recovery has recently received a great deal of attention. Most methods in common use are largely ad hoc. Because of this, they tend to have certain pathological cases which cause cascades of error messages. One method of avoiding these error cascades involves using a suffix parser - one which can parse an arbitrary suffix of the specified language. Once an error is detected, the parser is simply restarted to look for subsequent errors. Thus, no spurious error messages are ever generated. Earley's algorithm provides the basis for a general suffix parser. Using a suffix parser as described above allows recovery from syntax errors with no attempt at repair. The modified Earley parser leaves a large amount of information behind in the states it builds to describe its parsing actions which can be used to guide the search for potential repairs. An algorithm based on this fact is presented, along with a simple implementation.