Browse Prior Art Database

The Construction of Variant Translators for Icon

IP.com Disclosure Number: IPCOM000128305D
Original Publication Date: 1983-Dec-31
Included in the Prior Art Database: 2005-Sep-15
Document File: 13 page(s) / 39K

Publishing Venue

Software Patent Institute

Related People

Ralph E Griswold: AUTHOR [+3]

Abstract

A preprocessor, which translates text from source language (fto source language is a popular and effective means of implementing a, given an implementation of R is referred to as the tar-get language. Ratfor [1] is perhaps the best known and most widely used example of this technique, although there are many others. In some cases Ct is a variant of % An example is Cg [2), a variant of C that includes a generator facility similar to that of Icon [3]. Cg consists of C and some additional syntax that a preprocessor translates into standard C. A run-time system provides the necessary semantic support for generators. Note that the Cg preprocessor is a source-to-source translator:

This text was extracted from a PDF file.
This is the abbreviated version, containing approximately 11% of the total text.

Page 1 of 13

THIS DOCUMENT IS AN APPROXIMATE REPRESENTATION OF THE ORIGINAL.

The Construction of Variant Translators for Icon*

Ralph E Griswold

TR 83-19

December 31, 1983

Department of Computer Science The University of Arizona Tucson, Arizona 85721

*This work was supported by the National Science Foundation under Grant MCS81-01916.

1. Introduction

A preprocessor, which translates text from source language (fto source language is a popular and effective means of implementing a, given an implementation of R is referred to as the tar- get language. Ratfor [1] is perhaps the best known and most widely used example of this technique, although there are many others. In some cases Ct is a variant of % An example is Cg [2), a variant of C that includes a generator facility similar to that of Icon [3]. Cg consists of C and some additional syntax that a preprocessor translates into standard C. A run-time system provides the necessary semantic support for generators. Note that the Cg preprocessor is a source-to-source translator:

(Equation Omitted)

where Cg differs from C only in the addition of a few syntactic constructs. This can be viewed as an instance of a more general paradigm:

(Equation Omitted)

There are many other forms of variant translators. Some possibilities are: the deletion of features in order to subset a language the addition of monitoring code, written in the target language the insertion of termination code to output monitoring data the insertion of initialization code to incorporate additional run-time facilities the insertion of code for debugging and checking purposes [4,5] Such translations can be characterized by T - Ct and

(Equation Omitted)

In the latter case, the input text and the output text may be different, but they are both in C1 In both cases, the output of the variant translator can be processed by a standard translator for the target language Ct. One way to implement-a variant language is to modify a standard translator, avoiding the preprocessor. This approach may or may not be easy, depending on the translator. In general, it involves modifying the code generator, which often is tricky and error prone. Furthermore, if the variant is a trial one, the effort involved may discourage experiments. The standard way to produce variant translators is the one that is most often used for preprocessors in gen-eral, including ones that do not fit the variant translator paradigm - writing a stand-alone program in any convenient language. In the case of Ratfor, the preprocessor is written in Ratfor,

University of Arizona Page 1 Dec 31, 1983

Page 2 of 13

The Construction of Variant Translators for Icon

providing the advantages of bootstrapping. This approach presents several problems. In the first placv, writing a complete, efficient, and correct preprocessor is a substantial undertaking. In experimental work, this effort may be unwarranted, and it is common to write the preprocessor in a high-level language, handling only the var...