Skip to main content
Log in

Hierarchic syntax error repair for LR grammars

  • Published:
International Journal of Computer & Information Sciences Aims and scope Submit manuscript

Abstract

A description of a technique for handling syntax errors in compilers, called hierarchic error repair, is presented. The technique is simple to understand and to implement. It always repairs a source program into a syntactically valid program and never causes the parser to back up. Details of embedding the technique in the LR family of parsers are given.

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.

Institutional subscriptions

Similar content being viewed by others

References

  1. A. V. Aho and T. G. Peterson, “A Minimum Distance Error-Correcting Parser for Context-Free Languages,”SIAM Journal of Computing,1 (4):305–312 (December, 1972).

    Google Scholar 

  2. D. T. Barnard, “Automatic Generation of Syntax-Repairing and Paragraphing Parsers,” Computer Systems Research Group, University of Toronto, Technical Report CSRG-52 (April, 1975), pp. 1–132.

  3. D. T. Barnard, “Hierarchic Syntax Error Repair,” Ph.D. Thesis, Department of Computer Science, University of Toronto (March, 1981), pp. 1–253.

  4. D. T. Barnard, “Syntax Error Handling Techniques,” Technical Report 81-125, Department of Computing and Information Science, Queen's University (Canada), pp. 1–24.

  5. D. T. Barnard, H. Boldt, and H. Mankovitz, “Interactive Graphics for Compiler Specification,”Proceedings CIPS Conference, Canadian Information Processing Society (June 1981), pp. 1–5.

  6. J. R. Cordy and R. C. Holt, “Specification of Concurrent Euclid (Version 1),” Technical Report CSRG-131, Computer Systems Research Group, University of Toronto (August, 1981).

  7. C. N. Fischer, B. A. Dion, and J. Mauney, “A Locally Least-Cost LR-Error Corrector,” Technical Report 363, Computer Sciences Department, University of Wisconsin-Madison (August, 1979), pp. 1–47.

  8. C. Ghezzi, “LL(1) Grammars Supporting an Efficient Error Handling,”Information Processing Letters,3 (6):174–176 (July, 1975).

    Google Scholar 

  9. S. L. Graham and S. P. Rhodes, “Practical Syntactic Error Recovery,”CACM,18 (11): 639–650 (November, 1975).

    Google Scholar 

  10. S. L. Graham, C. B. Haley, and W. N. Joy, “Practical LR Error Recover,”Proceedings SIGPLAN Symposium on Compiler Construction, SIGPLAN Notices,14 (8):168–175 (August, 1979).

    Google Scholar 

  11. R. C. Holt, D. B. Wortman, D. T. Barnard, and J. R. Cordy, “SP/k: a System for Teaching Computer Programming,”CACM,20 (5):302–309 (May, 1977).

    Google Scholar 

  12. R. C. Holt, D. B. Wortman, J. R. Cordy, and D. R. Crowe, The Euclid Language: A Progress Report; Proceedings ACM National Conference (December 1978).

  13. R. C. Holt, J. R. Cordy, and D. B. Wortman, “An Introduction to S/SL: Syntax/ Semantic Language,’TOPLAS,4 (2):149–178 (April, 1982).

    Google Scholar 

  14. J. J. Horning, “What the Compiler Should Tell the User,” inCompiler Construction: An Advanced Course, F. L. Bauer and J. Eickel, Eds. (Springer-Verlag, 1976), pp. 525–548.

  15. D. E. Knuth, “On the Translation of Languages From Left to Right,”Information and Control,8 (6):607–639 (1965).

    Google Scholar 

  16. J.-P. Levy, “Automatic Correction of Syntax Errors in Programming Languages,”Acta Informatica,4:271–292 (1975).

    Google Scholar 

  17. M. D. Mickunas and J. A. Modry, “Automatic Error Recovery for LR Parsers,”CACM,21(6):459–465 (June, 1978).

    Google Scholar 

  18. A. B. Pai and R. B. Kieburtz, “Global Context Recovery: a New Strategy for Syntactic Error Recovery by Table-Driven Parsers,”TOPLAS,2 (1):18–41 (January, 1980).

    Google Scholar 

  19. T. J. Pennello and F. DeRemer, “A Forward Move Algorithm for LR Error Recovery,”Proceedings 5th ACM POPL Conference, ACM (1978), pp. 241–254.

  20. J. Rohrich, “Methods for Automatic Construction of Error Correcting Parsers,”Acta Informatica,13:115–138 (1980).

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Additional information

On leave from the Department of Computing and Information Science, Queen's University, Kingston, Ontario, Canada.

Rights and permissions

Reprints and permissions

About this article

Cite this article

Barnard, D.T., Holt, R.C. Hierarchic syntax error repair for LR grammars. International Journal of Computer and Information Sciences 11, 231–258 (1982). https://doi.org/10.1007/BF00999442

Download citation

  • Received:

  • Revised:

  • Issue Date:

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

Key words

Navigation