Advertisement

Acta Informatica

, Volume 13, Issue 2, pp 141–154 | Cite as

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

  • C. N. Fischer
  • D. R. Milton
  • S. B. Quiring
Article

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.

Keywords

Information System Operating System Data Structure Communication Network Information Theory 
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. 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)MathSciNetCrossRefGoogle Scholar
  2. 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 1972Google Scholar
  3. 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 1973Google Scholar
  4. 4.
    Aho, A.V., Ullman, J.D.: Principles of compiler design, pp. 391–402. Reading, Mass.: Addison-Wesley 1977Google Scholar
  5. 5.
    Conway, R.W., Wilcox, T.R.: Design and implementation of a diagnostic compiler for PL/I. Comm. ACM 16, 169–179 (1973)CrossRefGoogle Scholar
  6. 6.
    DeRemer, F.L.: Simple LR(k) grammars. Comm. ACM 14, 453–460 (1971)MathSciNetCrossRefGoogle Scholar
  7. 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 1978Google Scholar
  8. 8.
    Feyock, S., Lazarus, P.: Syntax-directed correction of syntax errors. Software Practice and Experience 6, 207–219 (1976)CrossRefGoogle Scholar
  9. 9.
    Fischer, C.N., Milton, D.R.: A locally least-cost LL(1) error corredtor (in press 1980)Google Scholar
  10. 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)MathSciNetCrossRefGoogle Scholar
  11. 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)Google Scholar
  12. 12.
    Ghezzi, C.: LL(1) grammars supporting an efficient error handling. Information Processing Letters 3, 6, 174–176 (1975)CrossRefGoogle Scholar
  13. 13.
    Graham, S.L., Rhodes, S.P.: Practical syntactic error recovery. Comm. ACM 18, 639–650 (1975)CrossRefGoogle Scholar
  14. 14.
    Gries, D.: The use of transition matrices in compiling. Comm. ACM 11, 26–34 (1968)CrossRefGoogle Scholar
  15. 15.
    Gries, D.: Compiler construction for digital computers, pp. 320–326. New York: Wiley 1971zbMATHGoogle Scholar
  16. 16.
    Holt, R.C., Barnard, D.T.: Syntax-directed error repair and paragraphing. IEEE Trans. on Software Engineering (in press 1980)Google Scholar
  17. 17.
    Irons, E.T.: An error-correcting parse algorithm. Comm. ACM 6, 669–673 (1963)CrossRefGoogle Scholar
  18. 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 1972Google Scholar
  19. 19.
    LaFrance, J.E.: Syntax directed error recovery for compilers. University of Illinois, Ph.D. thesis, Illiac IV Doc. 249, 1971Google Scholar
  20. 20.
    Leinius, R.P.: Error detection and recovery for syntax directed compiler systems. University of Wisconsin-Madison, Ph.D. thesis, 1970Google Scholar
  21. 21.
    Levy, J.P.: Automatic correction of syntax errors in programming languages. Cornell University, Ph.D. thesis, Tech. Report TR 71-116, 1971Google Scholar
  22. 22.
    Lewis, P.M., Rosenkrantz, D.J., Stearns, R.E.: Compiler design theory, pp. 276–284, 462–469, 526–531. Reading, Mass.: Addison-Wesley 1973zbMATHGoogle Scholar
  23. 23.
    Lyon, G.: Syntax-directed least-errors analysis for context-free languages: a practical approach. Comm. ACM 17, 3–14 (1974)CrossRefGoogle Scholar
  24. 24.
    Mickunas, M.D., Modry, J.A.: Automatic error recovery for LR parsers. Comm. ACM 21, 459–465 (1978)CrossRefGoogle Scholar
  25. 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, 1978Google Scholar
  26. 26.
    Peterson, T.G.: Syntax error detection, correction and recovery in parsers. Stevens Institute of Technology, Ph.D. thesis, 1972Google Scholar
  27. 27.
    Poplawski, D.A.: Error recovery for extended LL-Regular parsers. Purdue University, Ph.D. thesis, August 1978Google Scholar
  28. 28.
    Rhodes, S.P.: Practical syntactic error recovery for programming languages. University of California at Berkeley, Ph.D. thesis, Tech. Report 15, 1973Google Scholar
  29. 29.
    Tai, K.C.: Syntactic error correction in programming languages. IEEE Trans on Software Engineering Vol. SE-4, 5, 414–425 (1978)CrossRefGoogle Scholar
  30. 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, 1973Google Scholar

Copyright information

© Springer-Verlag 1980

Authors and Affiliations

  • C. N. Fischer
    • 1
  • D. R. Milton
    • 1
  • S. B. Quiring
    • 1
  1. 1.University of Wisconsin-MadisonMadisonUSA

Personalised recommendations