AST(1)

NAME
ast - generator for abstract structure/syntax trees

SYNOPSIS
ast [-options] [-ldir] [file]

DESCRIPTION
Ast generates a program module to handle arbitrary attributed trees and graphs. A typical application is the abstract syntax tree in a compiler. The input file contains a specification which describes the structure of all possible trees or nodes respectively and the attributes of the nodes. Ast generates type declarations to implement the tree and several procedures for tree manipulation including ASCII and binary readers and writers (see options below). If file is omitted the specification is read from standard input.

OPTIONS

a   generate all except -ch (default)

n
    generate node constructors    procedures n<node> (node)

m
    generate node constructors    procedures m<node> (make)

f
    generate node/tree destroyer    procedure ReleaseTREE (free)

F
    generate general destroyer    procedure ReleaseTREEModule (FREE)

o
    generate ASCII node writer    procedure WriteTREENode (output)

r
    generate ASCII graph reader    procedure ReadTREE

w
    generate ASCII graph writer    procedure WriteTREE

g
    generate binary graph reader    procedure GetTREE

p
    generate binary graph writer    procedure PutTREE

R
    generate list reverser    procedure ReverseTREE

t
    generate top down traversal    procedure TraverseTREETD
    (reverse depth first)

b
    generate bottom up traversal    procedure TraverseTREEBU
    (depth first)

y
    generate graph copy    procedure CopyTREE

=
    generate tree equality test    procedure IsEqualTREE

k
    generate graph checker    procedure CheckTREE

q
    generate graph browser    procedure QueryTREE

d   generate definition module

i   generate implementation module

s   generate import statements

4   generate tree/graph description in file VIEW.TS

6   generate # line directives

7   touch output files only if necessary

8   report storage consumption

c   generate C code (default: Modula-2)

h   print help information

ldir
    dir is the directory where ast finds its data files

FILES
if output is in C:

<module>.h	specification of the generated graph module
<module>.c	body of the generated graph module
yy<module>.w	macro file defining type specific operations

if output is in Modula-2:

<module>.md	definition module of the generated graph module
<module>.mi	implementation module of the generated graph module
<module>.imp	import statements

SEE ALSO

J. Grosch: "Ast - A Generator for Abstract Syntax Trees", GMD Forschungsstelle an der Universitaet Karlsruhe, Compiler Generation Report No. 15

J. Grosch: "Tool Support for Data Structures", Structured Programming, 12, 31-38 (1991)