Abstract
OPTRAN is a batch-oriented system for the generation of compilers that support program transformations. Programs are represented by attributed abstract syntax trees (AAST). The transformation of AAST's is a powerful method to describe problems in compiler writing such as machine-independent optimizations, language-based editors, and source-to-source translations.
The specification language OPTRAN allows for a static and declarative description of tree transformations. An OPTRAN transformation unit consists of a tree grammar specifying the underlying language of abstract syntax trees, an attribute grammar defining the decoration of these trees with semantic attributes, a set of transformation rules to be exhaustively applied to the attributed trees, and a strategy for the application of these rules.
Given such a specification, the system will automatically generate the transformation system, mainly consisting of efficient attribute evaluators and reevaluators, as well as a tree pattern matcher and transformer. The attribute grammar class accepted by the evaluator generator is the class of strongly noncircular AG's. Ordered partitions and evaluation plans are generated based upon an analysis of global dependencies, cf. [LMW89]. A linear time pattern matcher, a bottom up tree automaton, is generated from the set of input patterns of the transformation rules, cf. [MWW86]. Very effective table compression methods have been developped in order to arrive at acceptable table sizes, cf. [BMW91].
The main goal of the system design is the usage of precomputation methods wherever possible. The technique of Grammar Flow Analysis has been developped for that purpose, cf. [Mön91]. The static view of transformations makes it possible to generate highly efficient transformers.
The system is written in Pascal and generates Pascal programs. Pascal also serves as host language, i.e. semantic rules are specified as Pascal procedures. This complicates the error diagnosis of the runtime system as the semantics of these procedures is not obvious to the generator system. Furthermore it inhibits the recognition of certain properties of the specification like invariance of attribute assignments under non-trivial transformations. In that respect, OPTRAN could profit from a functional specification language. On the other hand, disciplined users can very effectively use the additional freedom they enjoy in an imperative language. Meanwhile, the execution time system has been translated to C with some gain in run time efficiency.
The system has been used for machine independent code optimization, semantic analysis, standardization of intermediate representation, and overload resolution in an Ada front end, code generation, and source-to-source translation.
Paitially supported by the Deutsche Forschungsgemeinschaft under Project “Manipulation of Attributed Trees” and the Commission of the European Community under Esprit Project Ref. 390 (PROSPECTRA).
Similar content being viewed by others
References
J. Börstler, U. Möncke, R. Wilhelm, “Table Compression for Tree Automata”, to appear in ACM Transaction on Programming Languages and Systems, 1991
P. Lipps, U. Möncke, R. Wilhelm, “OPTRAN — A Language/System for the Specification of Program Transformations: System Overview and Experiences”, LNCS 371, pp. 52–65, Springer-Verlag, 1989
P. Lipps, U. Möncke, M. Olk, R. Wilhelm, “Attribute (Re)evaluation in OPTRAN”, Acta Informatica 26, pp. 213–239, 1988
U. Möncke, B. Weisgerber, R. Wilhelm, “Generative Support for Transformational Programming”, ESPRIT '85: Status Report of Continuing Work, The Commission of the European Communities (eds.), pp. 511–527, Elsevier Science Publishers B. V. (North-Holland), 1986
U. Möncke, “Grammar Flow Analysis”, this volume
Author information
Authors and Affiliations
Editor information
Rights and permissions
Copyright information
© 1991 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Lipps, P., Möncke, U., Wilhelm, R. (1991). An overview of the OPTRAN system. In: Alblas, H., Melichar, B. (eds) Attribute Grammars, Applications and Systems. SAGA School 1991. Lecture Notes in Computer Science, vol 545. Springer, Berlin, Heidelberg. https://doi.org/10.1007/3-540-54572-7_21
Download citation
DOI: https://doi.org/10.1007/3-540-54572-7_21
Published:
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-54572-9
Online ISBN: 978-3-540-38490-8
eBook Packages: Springer Book Archive