Newsgroups: comp.object
Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!hellgate.utah.edu!defun.utah.edu!sandra
From: sandra%defun.utah.edu@cs.utah.edu (Sandra J Loosemore)
Subject: Re: OOD applied to interpreters and compilers
Date: Mon, 2-Oct-89 15:29:44 MDT
Message-ID: <1989Oct2.152944.16081@hellgate.utah.edu>
Keywords: OOD interpreters
Organization: PASS Research Group
References: <26873@genrad.UUCP>

In article <26873@genrad.UUCP> charlie@genrad.com (Charlie D. Havener) writes:
>It is not at all clear to me how to apply OOD or to use Object
>oriented programming style to the design of program language
>compilers or interpreters. 

I've been working on some code that is being used as part of both a
compiler and interpreter for Common Lisp.  The front end does certain
kinds of syntactic preprocessing on ordinary Lisp code (alphatization,
macroexpansion, and the like), and converts it to a parse tree
representation where each of the special forms in the language is a
different kind of object.  Each one of these special form types has
its own methods for evaluation, code generation, prettyprinting, etc.
I think that eventually it will be extended to support two other
dialects of Lisp (Standard Lisp and Scheme) as well.  Each dialect
will need its own codewalker, but they will be able to share quite a
few of the special form types and methods since there are a lot of
similarities between the semantics of the different dialects. 

-Sandra Loosemore (sandra@cs.utah.edu)