skip to main content
article
Open Access

On failure of the pruning technique in “Error repair in shift-reduce parsers”

Published:01 January 1999Publication History
Skip Abstract Section

Abstract

A previous article presented a technique to compute the least-cost error repair by incrementally generating configurations that result from inserting and deleting tokens a syntactically incorrect input. An additional mechanism to improve the run-time efficiency of this algorithm by pruning some of the configurations was discussed as well. In this communication we show that the pruning mechanism may lead to suboptimal repairs or may block all repairs. Certain grammatical errors in a common construct of the Java programming language also lead to the above kind of failure.

References

  1. AHO, A., SETHI, R., AND ULLMAN, J. 1986. Compilers: Principles, Techniques, and Tools. Addison-Wesley, Reading, Mass. Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. EARLEY, J. 1970. An efficient context-free parsing algorithm. Commun. ACM 13, 2 (Feb.), 94-102. Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. GOSLING, J., JOY, B., AND STEELE, G. 1996. The Java Language Specification. Addison-Wesley, Reading, Mass. Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. MCKENZIE, B., YEATMAN, C., AND DE VERE, L. 1995. Error repair in shift-reduce parsers. ACM Trans. Program. Lang. Syst. 17, 4 (July), 672-689. Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. On failure of the pruning technique in “Error repair in shift-reduce parsers”

    Recommendations

    Reviews

    Frank George Pagan

    This short and narrowly focused paper is essentially a piece of technical correspondence concerning an earlier paper [1] by McKenzie et al. in the same journal. The McKenzie paper presented a general method by which automatically generated LR parsers, by inserting and deleting tokens, can repair syntax errors in source programs, and a “pruning” heuristic by which the size of a search space associated with the repair method can be reduced, thereby improving the method's efficiency. In the paper under review, Bertsch and Nederhof show that the pruning heuristic is theoretically defective, in that it can lead to unnecessarily costly repairs and can even fail to find any repairs when feasible repairs exist. They do this by considering several very small grammars (between two and five rules each) and erroneous source strings, and exhibiting the details of the corresponding parsers and search spaces. In the conclusion, they briefly discuss some possibilities for improving the heuristic. Significantly, however, they also state that, for realistic grammars, complete failure of the original heuristic should be very rare and that less-than-optimal repairs are “by no means frequent.” They end by recommending the McKenzie technique “with only minor reservations.” The paper assumes that readers have a good knowledge of LR parsing. Given that, it comes close to being understandable independently of the McKenzie paper, although most interested readers will already have digested the latter. Only four references are cited; more can be found in the McKenzie paper. This paper is recommended to specialists in the technology of compiler generation.

    Access critical reviews of Computing literature here

    Become a reviewer for Computing Reviews.

    Comments

    Login options

    Check if you have access through your login credentials or your institution to get full access on this article.

    Sign in

    Full Access

    • Published in

      cover image ACM Transactions on Programming Languages and Systems
      ACM Transactions on Programming Languages and Systems  Volume 21, Issue 1
      Jan. 1999
      173 pages
      ISSN:0164-0925
      EISSN:1558-4593
      DOI:10.1145/314602
      Issue’s Table of Contents

      Copyright © 1999 ACM

      Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]

      Publisher

      Association for Computing Machinery

      New York, NY, United States

      Publication History

      • Published: 1 January 1999
      Published in toplas Volume 21, Issue 1

      Permissions

      Request permissions about this article.

      Request Permissions

      Check for updates

      Author Tags

      Qualifiers

      • article

    PDF Format

    View or Download as a PDF file.

    PDF

    eReader

    View online with eReader.

    eReader