m3astcontent, printing the content of a Modula-3 Abstract Syntax Tree

This program is useful both to understand how abstract syntax trees are represented in the m3tk library, and how to use the m3tk library for simple applications.

It accepts the usual m3tk options for specifying the location of units (modules, interfaces, generic modules...) and the name of units to process. Then, options specific to "m3astcontent" specify the compilations phases to perform before printing the ast. The options are the following:

-Tfile
Read the unit location map from "file". Typically the location map generated by m3build, .M3IMPTAB, is used.
file1 file2...
Process the units in the named files. By default the abstract syntax tree content is printed after the semantic analysis.
-parse
Only perform the lexical analysis before printing the ast.
-resolve
Only perform the lexical analysis and import/export resolution before printing the content of the ast.
-verbose
Print the list of units processed and imported/exported.

Here is a sample usage executed from within the m3astcontent package on a LINUXELF machine. It takes some time because many units within the m3tk library have to be processed for the full semantic analysis.

LINUXELF/m3astcontent -TLINUXELF/.M3IMPTAB src/Main.m3