Copyright (C) 1990, Digital Equipment Corporation.
All rights reserved.
See the file COPYRIGHT for a full description.

Last modified on Sat Apr  7 08:11:13 1990 by muller



Theses interfaces have been submitted by Greg Nelson. We plan to
implement them using the compiler. In the mean time, we include them 
in the release so that you can comment about them (send your comments
to m3@src.dec.com).

-----------------------------------------------------------------------

Modula-3 Abstract Syntax Trees
Draft, 22 January 1990
Greg Nelson

Here are a collection of interfaces for manipulating Modula-3 syntax 
trees, intended to be used by compilers, interpreters, 
pretty-printers, specification checkers, browsers, stub generators, 
and other applications that manipulate Modula-3 programs.

The basic interface AST reveals an undecorated parse tree.  For 
flexibility, there are operations for putting and getting arbitrary 
attributes on a node.  

The implementation-specific representation is defined in the ASTRep 
interface; it is not revealed in the basic interface.   

These interfaces were influenced by John Ellis's AST interface for 
M2+E and by Olivetti's AST interface for Modula-3.  John Ellis, Luca 
Cardelli, Jerome Chailloux, Bill Kalsow, and Eric Muller provided 
valuable comments.

Contents:

AST            Node types for the context free syntax
Property       Accessing client-defined node properties 
Atom           An Atom.T is like a Lisp atomic symbol
BuiltIn        Defines the atoms that name the built-in operators
Type           A Type.T is a representation for a Modula-3 type
Value          A Value.T is a representation for a Module-3 value
Entity         An Entity.T is a thing that a name can denote in a 
               Modula-3 program, a type, constant value, variable, 
               interface, etc.  
Scope          A Scope is a map from names to entities
TypedAST       Routines for typechecking an AST and decorating it with scopes.
NoisyAST       Declares data types for decorating an AST with information
               about comments and other syntactic noise.
ASTRep         Private types used to represent the nodes.
