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

  • Authors:
  • R. A. Ballance;J. Butcher;S. L. Graham

  • Affiliations:
  • Univ. of California, Berkeley, CA;Univ. of California, Berkeley, CA;Univ. of California, Berkeley, CA

  • Venue:
  • PLDI '88 Proceedings of the ACM SIGPLAN 1988 conference on Programming Language design and Implementation
  • Year:
  • 1988

Quantified Score

Hi-index 0.00

Visualization

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.