skip to main content
article
Open Access

Efficient incremental LR parsing for syntax-directed editors

Authors Info & Claims
Published:01 July 1988Publication History
Skip Abstract Section

Abstract

A technique for generating parsers which is an extension to LR techniques and is based on parsing table splitting, is presented. Then this technique is slightly extended to support incremental syntax analysis. Given a context-free grammar and a set “IC” of nonterminals devised to be incremental, a set of subtables is generated to drive the analysis of program fragments derivable from nonterminals in IC.

The proposed technique generates parsing tables which are considerably smaller than the standard ones, even when incrementality is not exploited. Thus, these tables may be stored as arrays permitting faster access and accurate error handling. Furthermore, our tables are suitable for generating syntax-directed editors which provide a full analytic mode. The efficiency of the analytic component of a syntax-directed editor obtained in this way and its easy integration with the generative component stress the advantages of incremental program writing.

References

  1. 1 AHO, A. V., AND ULMANN, J. D. The Theory of Parsing, Translation and Compiling, Vols. 1 and 2. Prentice-Hall, Englewood Cliffs, N.J., 1972. Google ScholarGoogle Scholar
  2. 2 AHO, A. V., AND ULMANN, J.D. Principles of Compiler Design. Prentice-Hall, Englewood Cliffs, N.J., 1977.Google ScholarGoogle Scholar
  3. 3 BAHLKE, R., AND SNELTING, G. The PSG system: From formal language definitions to interactive programming environments. ACM Trans. Program. Lang. Syst. 8, 4 (Oct. 1986), 547-576. Google ScholarGoogle Scholar
  4. 4 DEREMER, F., AND PENNELLO, T. Efficient computation of LALR(1) look-ahead sets. ACM Trans. Program. Lang. Syst. 4, 4 (Oct. 1982), 613-649. Google ScholarGoogle Scholar
  5. 5 DONZEAU-GOUGE, V., HUET, G., KAttN, G., LANG, B., AND LEVY, J.J. A structure-oriented program editor. Tech. Rep. INRIA, Le Chesnay, France, 1975.Google ScholarGoogle Scholar
  6. 6 GHEZZI, C., AND MANDRIOLI, D. Augmenting parsers to support incrementality. J. ACM 27, 3 (July 1980), 564-579. Google ScholarGoogle Scholar
  7. 7 HANSEN, W. Creation of hierarchic text with a computer display. Ph.D. dissertation, Computer Science Dept., Stanford Univ., Stanford, Calif., June 1971. Google ScholarGoogle Scholar
  8. 8 JALILI, F., AND GALLIER, J.H. Building friendly parsers. In Proceedings of 9th Annual ACM Symposium on Principles of Programming Languages (Albuquerque, N.M., Jan. 25-27, 1982). ACM, New York, 1982, pp. 196-206. Google ScholarGoogle Scholar
  9. 9 KORENJAK, A.J. A practical method for constructing LR(k) processors. Commun. ACM 12, 11 (Nov. 1969), 613-623. Google ScholarGoogle Scholar
  10. 10 MEDINA-MORA, R., AND FEILER, P. An incremental programming environment. IEEE Trans. Softw. Eng. SE-7, 5 (Sept. 1981), 472-482.Google ScholarGoogle Scholar
  11. 11 MICHELSON, M., AND WEGMAN, M. $. PDEiL: The PLIL program development environment: Principles of operation. Res. Rep. RC8513, IBM T. J. Watson Research Center, Yorktown Heights, N.Y., Nov. 1980.Google ScholarGoogle Scholar
  12. 12 REPS, T., TEITELBAUM, W., AND DEMERS, A. Incremental context-dependent analysis for language-based editors. ACM Trans. Program. Lang. Syst. 5, 3 (July 1983), 439-447. Google ScholarGoogle Scholar
  13. 13 TEITELBAUM, T., AND REPS, T. The Cornell program synthesizer: A syntax-directed programming environment. Commun. ACM 24, 9 (Sept. 1981), 563-573. Google ScholarGoogle Scholar
  14. 14 WEGMAN, U. $. Parsing for structural editors. In Proceedings of the 21th Annual Symposium on Foundations of Computer Science (1980). IEEE, New York, 1980, pp. 320-327.Google ScholarGoogle Scholar
  15. 15 WILCOX, T. R., DAVIS, A. M., AND TINDALL, M. $. The design and implementation of a table driven, interactive diagnostic programming system. Commun. ACM 19, 11 (Nov. 1976), 609-616. Google ScholarGoogle Scholar

Index Terms

  1. Efficient incremental LR parsing for syntax-directed editors

        Recommendations

        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 10, Issue 3
          July 1988
          158 pages
          ISSN:0164-0925
          EISSN:1558-4593
          DOI:10.1145/44501
          Issue’s Table of Contents

          Copyright © 1988 ACM

          Publisher

          Association for Computing Machinery

          New York, NY, United States

          Publication History

          • Published: 1 July 1988
          Published in toplas Volume 10, Issue 3

          Permissions

          Request permissions about this article.

          Request Permissions

          Check for updates

          Qualifiers

          • article

        PDF Format

        View or Download as a PDF file.

        PDF

        eReader

        View online with eReader.

        eReader