Skip to main content
Log in

Efficient LL(1) error correction and recovery using only insertions

  • Published:
Acta Informatica Aims and scope Submit manuscript

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.

This is a preview of subscription content, log in via an institution to check access.

Access this article

Price excludes VAT (USA)
Tax calculation will be finalised during checkout.

Instant access to the full article PDF.

Similar content being viewed by others

References

  1. 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)

    Article  MathSciNet  Google Scholar 

  2. 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

    Google Scholar 

  3. 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

    Google Scholar 

  4. Aho, A.V., Ullman, J.D.: Principles of compiler design, pp. 391–402. Reading, Mass.: Addison-Wesley 1977

    Google Scholar 

  5. Conway, R.W., Wilcox, T.R.: Design and implementation of a diagnostic compiler for PL/I. Comm. ACM 16, 169–179 (1973)

    Article  Google Scholar 

  6. DeRemer, F.L.: Simple LR(k) grammars. Comm. ACM 14, 453–460 (1971)

    Article  MathSciNet  Google Scholar 

  7. 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

  8. Feyock, S., Lazarus, P.: Syntax-directed correction of syntax errors. Software Practice and Experience 6, 207–219 (1976)

    Article  Google Scholar 

  9. Fischer, C.N., Milton, D.R.: A locally least-cost LL(1) error corredtor (in press 1980)

  10. 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)

    Article  MathSciNet  Google Scholar 

  11. 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)

  12. Ghezzi, C.: LL(1) grammars supporting an efficient error handling. Information Processing Letters 3, 6, 174–176 (1975)

    Article  Google Scholar 

  13. Graham, S.L., Rhodes, S.P.: Practical syntactic error recovery. Comm. ACM 18, 639–650 (1975)

    Article  Google Scholar 

  14. Gries, D.: The use of transition matrices in compiling. Comm. ACM 11, 26–34 (1968)

    Article  Google Scholar 

  15. Gries, D.: Compiler construction for digital computers, pp. 320–326. New York: Wiley 1971

    MATH  Google Scholar 

  16. Holt, R.C., Barnard, D.T.: Syntax-directed error repair and paragraphing. IEEE Trans. on Software Engineering (in press 1980)

  17. Irons, E.T.: An error-correcting parse algorithm. Comm. ACM 6, 669–673 (1963)

    Article  Google Scholar 

  18. 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

  19. LaFrance, J.E.: Syntax directed error recovery for compilers. University of Illinois, Ph.D. thesis, Illiac IV Doc. 249, 1971

  20. Leinius, R.P.: Error detection and recovery for syntax directed compiler systems. University of Wisconsin-Madison, Ph.D. thesis, 1970

  21. Levy, J.P.: Automatic correction of syntax errors in programming languages. Cornell University, Ph.D. thesis, Tech. Report TR 71-116, 1971

  22. Lewis, P.M., Rosenkrantz, D.J., Stearns, R.E.: Compiler design theory, pp. 276–284, 462–469, 526–531. Reading, Mass.: Addison-Wesley 1973

    MATH  Google Scholar 

  23. Lyon, G.: Syntax-directed least-errors analysis for context-free languages: a practical approach. Comm. ACM 17, 3–14 (1974)

    Article  Google Scholar 

  24. Mickunas, M.D., Modry, J.A.: Automatic error recovery for LR parsers. Comm. ACM 21, 459–465 (1978)

    Article  Google Scholar 

  25. 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

  26. Peterson, T.G.: Syntax error detection, correction and recovery in parsers. Stevens Institute of Technology, Ph.D. thesis, 1972

  27. Poplawski, D.A.: Error recovery for extended LL-Regular parsers. Purdue University, Ph.D. thesis, August 1978

  28. Rhodes, S.P.: Practical syntactic error recovery for programming languages. University of California at Berkeley, Ph.D. thesis, Tech. Report 15, 1973

  29. Tai, K.C.: Syntactic error correction in programming languages. IEEE Trans on Software Engineering Vol. SE-4, 5, 414–425 (1978)

    Article  Google Scholar 

  30. 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

Download references

Author information

Authors and Affiliations

Authors

Additional information

Research supported in part by National Science Foundation Grant MCS78-02570

Rights and permissions

Reprints 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

Download citation

  • Received:

  • Revised:

  • Published:

  • Issue Date:

  • DOI: https://doi.org/10.1007/BF00263990

Keywords

Navigation