Attribute grammar inversion and source-to-source translation
This thesis investigates the idea of attribute grammar inversion and how this technique can be used to build source-to-source translators. An attribute grammar is a declarative formalism for specifying the translation from one language to another. The basis of an attribute grammar is a context-free grammar. This grammar specifies the source language. An attribute grammar augments the context-free grammar with attributes and semantic functions in order to define a translation from a source language to a target language. This thesis shows that given an attribute grammar specifying the translation T from language L1 to language L2, one can automatically construct the attribute grammar specifying the inverse translation T/sup -1/ from language L2 back to language L1. The INVERT system implements the inversion algorithm, employing several special techniques to help create efficient inverse specification. After discussing the theoretical and practical issues of attribute grammar inversion, it is demonstrated how the technique can be used to build source-to0source translators. To prove the feasibility of the inversion approach to source-to-source translation, it has been used to generate translators between the programming languages Pascal and C.
- Research Organization:
- Columbia Univ., New York (USA)
- OSTI ID:
- 7106897
- Country of Publication:
- United States
- Language:
- English
Similar Records
Semantics for coordinated substitution grammars as implemented in Prolog
Compiling circular attribute grammars into Prolog