Skip to main content
U.S. Department of Energy
Office of Scientific and Technical Information

Attribute grammar inversion and source-to-source translation

Thesis/Dissertation ·
OSTI ID:7106897

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

Attribute grammars and data-flow languages
Conference · Wed Jun 01 00:00:00 EDT 1983 · SIGPLAN Not.; (United States) · OSTI ID:5210274

Semantics for coordinated substitution grammars as implemented in Prolog
Thesis/Dissertation · Wed Dec 31 23:00:00 EST 1986 · OSTI ID:6673900

Compiling circular attribute grammars into Prolog
Journal Article · Thu May 01 00:00:00 EDT 1986 · IBM J. Res. Dev.; (United States) · OSTI ID:5480888