Abstract Syntax Tree
The Clef AST is a High level representation of a program which is close to the original source program.
The Scale Clef AST is called the Common Language Encoding Form (Clef).
- High level optimizations can modify the Clef AST to provide improved code generation.
- High level analysis can influence lower level optimizations through the addition of Annotations
- High level forms can be lowered
Example: subscript expression transformed to address expressions.
The Clef AST consists of nodes that are:
- types
- integer, real, pointer, etc
- declarations
- variables, procedures, etc
- expressions
- arithmetic operators, allocation, catenation, etc
- statements
- if-then-else, Fortran DO, throw & catch, etc
Many of the nodes are specific to a specific programming language (e.g., Fortran DO) while others are more general (e.g., if-then-else).
Annotations may be attached to any node.
Example Clef AST
Return to Scale dataflow diagram.
Return to Scale home page.
(Last changed: March 21, 2007.)