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.
Similar content being viewed by others
References
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).
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.
D. T. Barnard, “Hierarchic Syntax Error Repair,” Ph.D. Thesis, Department of Computer Science, University of Toronto (March, 1981), pp. 1–253.
D. T. Barnard, “Syntax Error Handling Techniques,” Technical Report 81-125, Department of Computing and Information Science, Queen's University (Canada), pp. 1–24.
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.
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).
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.
C. Ghezzi, “LL(1) Grammars Supporting an Efficient Error Handling,”Information Processing Letters,3 (6):174–176 (July, 1975).
S. L. Graham and S. P. Rhodes, “Practical Syntactic Error Recovery,”CACM,18 (11): 639–650 (November, 1975).
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).
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).
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).
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).
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.
D. E. Knuth, “On the Translation of Languages From Left to Right,”Information and Control,8 (6):607–639 (1965).
J.-P. Levy, “Automatic Correction of Syntax Errors in Programming Languages,”Acta Informatica,4:271–292 (1975).
M. D. Mickunas and J. A. Modry, “Automatic Error Recovery for LR Parsers,”CACM,21(6):459–465 (June, 1978).
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).
T. J. Pennello and F. DeRemer, “A Forward Move Algorithm for LR Error Recovery,”Proceedings 5th ACM POPL Conference, ACM (1978), pp. 241–254.
J. Rohrich, “Methods for Automatic Construction of Error Correcting Parsers,”Acta Informatica,13:115–138 (1980).
Author information
Authors and Affiliations
Additional information
On leave from the Department of Computing and Information Science, Queen's University, Kingston, Ontario, Canada.
Rights 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
Received:
Revised:
Issue Date:
DOI: https://doi.org/10.1007/BF00999442