Affiliation:
1. Courant Institute, New York University, 251 Mercer Street, New York, New York
Abstract
Our goal is to develop a practical syntactic error recovery method applicable within the general framework of viable prefix parsing. Our method represents an attempt to accurately diagnose and report all syntax errors without reporting errors that are not actually present. Successful recovery depends upon accurate diagnosis of errors together with sensible “correction” or alteration of the text to put the parse back on track. The issuing of accurate and helpful diagnostics is achieved by indicating the nature of the recovery made for each error encountered. The error recovery is prior to and independent of any semantic analysis of the program. However, the method does not exclude the invocation of semantic actions while parsing or preclude the use of semantic information for error recovery.
The method assumes a framework in which an LR or LL parser, driven by the tables produced by a parser generator, maintains an input symbol buffer, state or prediction stack, and parse stack. The input symbol buffer contains part or all of the sequence of remaining input tokens, including the current token. The LR state stack is analogous to the LL prediction stack; except when restricting our attention to the LL case, prediction stack shall serve as a generic term indicating the LR state or LL prediction stack. The parse stack contains the symbols of the right hand sides that have not yet been reduced.
Publisher
Association for Computing Machinery (ACM)
Subject
Computer Graphics and Computer-Aided Design,Software
Reference7 articles.
1. Feyock S. Lazurus P. "Syntax-directed Correction of Syntax Errors" Software Practice and Experience Vol. 6 1976. Feyock S. Lazurus P. "Syntax-directed Correction of Syntax Errors" Software Practice and Experience Vol. 6 1976.
2. Graham S.L. Haley C.B. Joy W.N. "Practical LR Error Recovery" SIGPLAN Notices August 1979. 10.1145/872732.806967 Graham S.L. Haley C.B. Joy W.N. "Practical LR Error Recovery" SIGPLAN Notices August 1979. 10.1145/872732.806967
3. Graham S.L. Rhodes S.P. "Practical Syntactic Error Recovery" CACM November 1975. 10.1145/361219.361223 Graham S.L. Rhodes S.P. "Practical Syntactic Error Recovery" CACM November 1975. 10.1145/361219.361223
4. Johnson S.C. YACC - Yet Another Compiler Compiler. Bell Laboratories Murray Hill 1977. Johnson S.C. YACC - Yet Another Compiler Compiler. Bell Laboratories Murray Hill 1977.
5. Poonen G. "Error Recovery For LR(k) Parsers" Information Processing August 1977. Poonen G. "Error Recovery For LR(k) Parsers" Information Processing August 1977.
Cited by
4 articles.
订阅此论文施引文献
订阅此论文施引文献,注册后可以免费订阅5篇论文的施引文献,订阅后可以查看论文全部施引文献