Prev No Next Up Home Keys Figs Search New

Parse Tree Notation

Appeared in Volume 7/3. August 1994

Keywords: grammars.

Parse Tree Notation (PTN) facilitates the encoding of language translators which transform programs written in high level languages with extensions (e.g. a logic language with functional programming features) into equivalent programs in the original unextended languages (e.g. Prolog). PTN does this by offering a small set of operations and built-in predicates for manipulating program parse trees. More complicated actions can be readily coded by combining PTN with Prolog predicates.

The main PTN operation augments unification with pattern matching capabilities based on the Definite Clause Grammar (DCG) for the language of the program being manipulated. This allows parse tree searches to be specified, based on the terminal and nonterminal types of the language, without the programmer having to augment the DCG or to write specialised tree manipulation predicates.

The PTN system is available by anonymous FTP from:
ftp://turiel.cs.mu.oz.au/pub/ptn
The directory contains two files: README and ptn.tar.Z

There are numerous example translators in the distribution, including:

PTN notation in a translator is itself translated into vanilla Prolog using a PTN translator.

A Postscript version of the paper `Parse Tree Notation', by A. Davison and E. Haywood is included with the distribution. This paper, combined with the numerous README files, supplies extensive information on the capabilities of PTN.

PTN is implemented in NU-Prolog, but mostly uses ISO-standard Prolog built-ins. There is a small file containing NU-Prolog specific predicates, and these should be easily ported to your Prolog dialect.

For more information, contact:

Andrew Davison or Elizabeth Haywood
Dept. of Computer Science
University of Melbourne
Melbourne, Victoria 3052, Australia
Email: ad@cs.mu.oz.au,
       lizh@cs.mu.oz.au
Fax: +61 3 348 1184
Tel: +61 3 287 9172 / 9101
Telex: AA 35185

Prev No Next Up Home Keys Figs Search New