An interpreter generator using tree pattern matching

  • Authors:
  • Christoph M. Hoffmann;Michael J. O'Donnell

  • Affiliations:
  • Purdue University, W. Lafayette, IN;Purdue University, W. Lafayette, IN

  • Venue:
  • POPL '79 Proceedings of the 6th ACM SIGACT-SIGPLAN symposium on Principles of programming languages
  • Year:
  • 1979

Quantified Score

Hi-index 0.00

Visualization

Abstract

Equations provide a rich, intuitively understandable notation for describing nonprocedural computing languages such as LISP and Lucid. In this paper, we present techniques for automatically generating interpreters from equations, analagous to well-known techniques for generating parsers from context-free grammars. The interpreters so generated are exactly faithful to the simple traditional mathematical meaning of the equations-no lattice-theoretic or fixpoint ideas are needed to explain the correspondence. The main technical problem involved is the extension of efficient practical string matching algorithms to trees. We present some new efficient table-driven matching techniques for a large class of trees, and point out unsolved problems in extending this class. We believe that the techniques of this paper form the beginnings of a useful discipline of interpreting, comparable to the existing discipline of parsing.