Abstract
An LL(1)-based error-corrector which operates by insertion-only is studied. The corrector is able to correct and parse any input string. It is efficient (linear in space and time requirements) and chooses least-cost insertions (as defined by the user) in correcting syntax errors. Moreover, the error-corrector can be generated automatically from the grammar and a table of terminal symbol insertion costs. This method is also very well suited for use as an automatic error-recovery technique in LL(1) parsers. The class of LL(1) grammars correctable by this method contains (with minor modifications) grammars used to specify most common programming languages. Preliminary results suggest that this method can be used to advantage in LL(1)-driven compilers.
Similar content being viewed by others
References
Aho, A.V., Peterson, T.G.: A minimum distance error correcting parser for context-free languages. SIAM Journal of Computing 1, 4, 305–312 (1972)
Aho, A.V., Ullman, J.D.: The theory of parsing, translation and compiling, Vol. 1, Sec. 5.1. Englewood Cliffs, N.J.: Prentice-Hall 1972
Aho, A.V., Ullman, J.D.: The theory of parsing, translation and compiling, Vol. 2, pp. 674–675. Englewood Cliffs, N.J.: Prentice-Hall 1973
Aho, A.V., Ullman, J.D.: Principles of compiler design, pp. 391–402. Reading, Mass.: Addison-Wesley 1977
Conway, R.W., Wilcox, T.R.: Design and implementation of a diagnostic compiler for PL/I. Comm. ACM 16, 169–179 (1973)
DeRemer, F.L.: Simple LR(k) grammars. Comm. ACM 14, 453–460 (1971)
Dion, B.A.: Locally least-cost error correctors for context-free and context-sensitive parsers. University of Wisconsin-Madison, Ph.D. thesis, Tech. Report 344, December 1978
Feyock, S., Lazarus, P.: Syntax-directed correction of syntax errors. Software Practice and Experience 6, 207–219 (1976)
Fischer, C.N., Milton, D.R.: A locally least-cost LL(1) error corredtor (in press 1980)
Fischer, C.N., Tai, K.C., Milton, D.R.: Immediate error detection in strong LL(1) parsers. Information Processing Letters 8, 5, 261–266 (1979)
Fischer, C.N., Dion, B.A.: On testing for insert-correctability in context-free grammars. University of Wisconsin-Madison, Techn. Report 355, July 1979. Acta Informatica (in press 1980)
Ghezzi, C.: LL(1) grammars supporting an efficient error handling. Information Processing Letters 3, 6, 174–176 (1975)
Graham, S.L., Rhodes, S.P.: Practical syntactic error recovery. Comm. ACM 18, 639–650 (1975)
Gries, D.: The use of transition matrices in compiling. Comm. ACM 11, 26–34 (1968)
Gries, D.: Compiler construction for digital computers, pp. 320–326. New York: Wiley 1971
Holt, R.C., Barnard, D.T.: Syntax-directed error repair and paragraphing. IEEE Trans. on Software Engineering (in press 1980)
Irons, E.T.: An error-correcting parse algorithm. Comm. ACM 6, 669–673 (1963)
James, L.R.: A syntax directed error recovery method. University of Toronto, M.S. thesis, Computer Systems Research Group Tech. Report CSRG-13, May 1972
LaFrance, J.E.: Syntax directed error recovery for compilers. University of Illinois, Ph.D. thesis, Illiac IV Doc. 249, 1971
Leinius, R.P.: Error detection and recovery for syntax directed compiler systems. University of Wisconsin-Madison, Ph.D. thesis, 1970
Levy, J.P.: Automatic correction of syntax errors in programming languages. Cornell University, Ph.D. thesis, Tech. Report TR 71-116, 1971
Lewis, P.M., Rosenkrantz, D.J., Stearns, R.E.: Compiler design theory, pp. 276–284, 462–469, 526–531. Reading, Mass.: Addison-Wesley 1973
Lyon, G.: Syntax-directed least-errors analysis for context-free languages: a practical approach. Comm. ACM 17, 3–14 (1974)
Mickunas, M.D., Modry, J.A.: Automatic error recovery for LR parsers. Comm. ACM 21, 459–465 (1978)
Pennello, T.J., DeRemer, F.L.: A forward move algorithm for LR error recovery. Proc. Conference Record of the Fifth Annual ACM Symposium on Principles of Programming Languages, Tucson, Arizona, pp. 241–254, 1978
Peterson, T.G.: Syntax error detection, correction and recovery in parsers. Stevens Institute of Technology, Ph.D. thesis, 1972
Poplawski, D.A.: Error recovery for extended LL-Regular parsers. Purdue University, Ph.D. thesis, August 1978
Rhodes, S.P.: Practical syntactic error recovery for programming languages. University of California at Berkeley, Ph.D. thesis, Tech. Report 15, 1973
Tai, K.C.: Syntactic error correction in programming languages. IEEE Trans on Software Engineering Vol. SE-4, 5, 414–425 (1978)
Teitlebaum, R.: Context-free error analysis by evaluation of algebraic power series. Proc. ACM SIGACT Fifth Annual Conference on Theory of Computing, Austin, Texas, pp. 196–199, 1973
Author information
Authors and Affiliations
Additional information
Research supported in part by National Science Foundation Grant MCS78-02570
Rights and permissions
About this article
Cite this article
Fischer, C.N., Milton, D.R. & Quiring, S.B. Efficient LL(1) error correction and recovery using only insertions. Acta Informatica 13, 141–154 (1980). https://doi.org/10.1007/BF00263990
Received:
Revised:
Published:
Issue Date:
DOI: https://doi.org/10.1007/BF00263990