skip to main content
article
Free Access

Grammatical abstraction and incremental syntax analysis in a language-based editor

Published:01 June 1988Publication History
Skip Abstract Section

Abstract

Processors for programming languages and other formal languages typically use a concrete syntax to describe the user's view of a program and an abstract syntax to represent language structures internally. Grammatical abstraction is defined as a relationship between two context-free grammars. It formalizes the notion of one syntax being “more abstract” than another. Two variants of abstraction are presented. Weak grammatical abstraction supports (i) the construction during LR parsing of an internal representation that is closely related to the abstract syntax and (ii) incremental LR parsing using that internal representation as its base. Strong grammatical abstraction tightens the correspondence so that top-down construction of incrementally-parsable internal representations is possible. These results arise from an investigation into language-based editing systems, but apply to any program that transforms a linguistic object from a representation in its concrete syntax to a representation in its abstract syntax or vice versa.

References

  1. 1 A. V. Aho and S. C. Johnson. Deterministic parsing of ambiguous grammars. Communications of the ACM, 18(8):441-452, August 1975. Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. 2 Robert A. Ballance, Jacob Butcher, and Susan L. Graham. Incremental Parsing in the Pan Language. Based Editor. Technical Report 88/??, Computer Science Division, UC Berkeley, March 1988.Google ScholarGoogle Scholar
  3. 3 Robert A. Ballance, Michael L. Van De Vanter, and Susan L. Graham. The Architecture of Pan I. Technice1 Report 88/409, Computer Science Division, UC Berkeley, March 1988. Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. 4 Jacob Butcher. Master of science report. 1988. Computer Science Division- EECS, University of California, Berkeley. In preparation.Google ScholarGoogle Scholar
  5. 5 F. L. DeRemer. Compiler Construction; An Advanced Course, chapter Transformational Grammars, pages 109-120. Springer-Verlag, New York, Heidelberg, Berlin, second edition, 1976. Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. 6 V. Donzeau-Gouge, G. Huet, G. Kahn, and B. Lang. Programming Environments Baaed on Structure Editors: The MENTOR Experience. Research Report 26, INRIA, July 1980.Google ScholarGoogle Scholar
  7. 7 Susan L. Graham. On bounded right context languages and grammars. SIAM Journal on Computing, 3(a):224-254, 1974.Google ScholarGoogle Scholar
  8. 8 James N. Gray and Michael A. Harrison. On the covering and reduction problems for context-free grammars. Journal of the A CM, 19(4):675-698, October 1972. Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. 9 Michael A. Harrison. Introduction to Formal Language Theory. Addison-Wesley, Reading, Mass., 1978. Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. 10 H. B. Hunt, D.J. Rosenkrantz, and T.G. Szymanski. The covering problem for linear context-free grammars. Theoretical Computer Science, 2:361- 382, 1976.Google ScholarGoogle ScholarCross RefCross Ref
  11. 11 Fahimeh Jalili and Jean H. Gallier. Building friendly parsers. In A CM Ninth Symposium on the Principles of Programming Languages, pages 196-206, 1982. Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. 12 G. Kahn, B. Lang, B. Melese, and E. Morcos. Metal: a formalism to specify formalisms. Science of Computer Programming, 3:152-188, 1983.Google ScholarGoogle ScholarCross RefCross Ref
  13. 13 Uwe Kastens. Personal communication.Google ScholarGoogle Scholar
  14. 14 Bent Bruun Kristensen, Ole Lehrmann Madsen, Birger MZller-Pedersen, and Kristen Nygaard. An algebra for program fragments. In Proceedings of the A CM SIGPLAN 85 Symposium on Language Issues in Programming Environments, pages 161-170, 1985. Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. 15 Wilf R. LaLonde. Regular right-part grammars and their parsers. Communications of the A CM, 20(10):731-741, October 1977. Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. 16 Anton Nijholt. Context-Free Grammars: Covers, Normal Forms, and Parsing. Volume 93 of Lecture Notes in Computer Science, Springer-Verlag, New York, Heidelberg, Berlin, 1980. Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. 17 Robert E. Noonan. An algorithm for generating abstract syntax trees. Computer Languages, 10($/4):225-2s6, 19ss. Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. 18 D. J. Rosenkrantz and H. }3. Hunt. Efficient algorithms for automatic construction and compactification of parsing grammars. AC'M Transactions on Programming Languages and Systems, 9(4), 1987. Google ScholarGoogle ScholarDigital LibraryDigital Library
  19. 19 Tim Teitelbaum and Thomas Reps. The Cornell program synthesizer: a syntkx-directed programming environment. C'AC'M, 24(9):563-573, Sep 1981. Google ScholarGoogle ScholarDigital LibraryDigital Library
  20. 20 Vance E. Waddle. Production Trees: A Compact Representation of Parsed Programs. Technical Report, IBM Thomas J. Watson Research Center, 1986.Google ScholarGoogle Scholar

Index Terms

  1. Grammatical abstraction and incremental syntax analysis in a language-based editor

            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 SIGPLAN Notices
              ACM SIGPLAN Notices  Volume 23, Issue 7
              Proceedings of the SIGPLAN '88 conference on Programming language design and implementation
              July 1988
              338 pages
              ISSN:0362-1340
              EISSN:1558-1160
              DOI:10.1145/960116
              Issue’s Table of Contents
              • cover image ACM Conferences
                PLDI '88: Proceedings of the ACM SIGPLAN 1988 conference on Programming language design and implementation
                June 1988
                338 pages
                ISBN:0897912691
                DOI:10.1145/53990

              Copyright © 1988 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 June 1988

              Check for updates

              Qualifiers

              • article

            PDF Format

            View or Download as a PDF file.

            PDF

            eReader

            View online with eReader.

            eReader