Generally speaking, there are three functional modules in the package:
- Language parser. It can convert some language source code (currently HPF) to our intermediate representation (IR). The IR, as described in Intermediate representation are different kinds of structure nodes recording information in the source code, threaded together by two kinds of link: list link and tree link.
- Tool box. It contains dumpdep and unparse two parts, which will display the intermediate representation generated by language parser in different ways: either by printing each kind of nodes along the list or by translating the nodes back to the source code.
- A compiler construction library. It provides operations on the intermediate representation. These include functions for constructing nodes, analysing information stored in them, and restructuring the link between them. They are organized as C++ class methods as described in Class library.
From the above, we can see that once defined according to a specific language, the intermediate representation is the kernel part of the functional modules. The whole package can be extended based on this.
First, the IR can be defined to express more kind of programming languaes, as we will see its structure in the next section. Currently we are only working on Fortran and Java. Sage++ system used the same kind of IR for C/C++.
Second, the library functions can also be extended easily. As we will see, the organization of the library makes it quite easy to add a new method to a language component, such as a statement or expression. Different kinds of analyzing and restructuring operations can be developed as member functions.
Email contact: zgs@npac.syr.edu