Browse Prior Art Database

Automatically Generating Compiler Back-End Emitters

IP.com Disclosure Number: IPCOM000112347D
Original Publication Date: 1994-Apr-01
Included in the Prior Art Database: 2005-Mar-27
Document File: 2 page(s) / 96K

Publishing Venue

IBM

Related People

Acker, LE: AUTHOR [+3]

Abstract

A program is disclosed that automatically generates new compiler back-end emitters for the SOM Compiler. This program is based on SOM's Emitter Framework. The Emitter Framework is driven by the SOM Compiler. Hence this technique uses the SOM Compiler to generate its own emitters.

This text was extracted from an ASCII text file.
This is the abbreviated version, containing approximately 52% of the total text.

Automatically Generating Compiler Back-End Emitters

      A program is disclosed that automatically generates new
compiler back-end emitters for the SOM Compiler.  This program is
based on SOM's Emitter Framework.  The Emitter Framework is driven by
the SOM Compiler.  Hence this technique uses the SOM Compiler to
generate its own emitters.

      System Object Model (SOM) is a technology for object-oriented
programming.  In SOM, the programmer specifies the interface to a
class of objects in one language (IDL) and the implementation of the
class in his/her preferred programming language (e.g., C or C++).
The SOM Compiler translates the IDL interface specification into a
variety of different output forms, including binding files,
implementation templates, and export files.  The SOM Emitter
Framework is an object-oriented class library that developers can use
to write new back-end emitters for the SOM Compiler.  Using the
Emitter Framework, users can extend the SOM Compiler to produce any
desired output format, including bindings for languages that the SOM
Compiler does not directly support.  The SOM Compiler analyzes the
input IDL specification, produces a data structure representing the
input, and passes it to the specified user-written emitter.  The
Emitter Framework simplifies the process of writing a new emitter
because it is template-based: the developer describes the desired
output in the form of a template rather than writing code to format
the output.

      To enable users of the Emitter Framework to quickly develop new
emitters, an emitter is written (using the Emitter Framework) that
automatically generates a new emitter.  The developer can then
further customize the new emitter.  In other words, this invention
allows the SOM Compiler to automatically generate new emitters for
itself.

      The invention presented here is a facility for automatically
generating new emitters for the SOM Compiler.  It is itself an
emitter, written using the Emitter Framework.  The interface for the
facility, called "newemit", is a script (command file) that takes two
arguments: the name of the new emitter and the file stem of its
associated files.  Call these two arguments <name> and <stem>.  The
newemit script uses the "gen" emitter to generate the various files
needed by the new emitter:  its IDL specification, its implementation
file, its driver program, its template file, its export file, and its
Makefile.  The "gen" emitter is an emitter that substitutes <name>
and <stem> in each of its output templates to produce the different
output files.  The "gen" emitter has a different output template for
each of the output files it produces (one corresponding to the new
emitter's .idl file, one for i...