Re: object oriented compiler/interpreter-HOWTO (Paolo Bonzini)
23 Jul 2000 16:54:13 -0400

          From comp.compilers

Related articles
object oriented compiler/interpreter - HOWTO (Brett) (2000-07-18)
Re: object oriented compiler/interpreter-HOWTO (2000-07-23)
| List of all articles for this month |

From: (Paolo Bonzini)
Newsgroups: comp.compilers
Date: 23 Jul 2000 16:54:13 -0400
Organization: Mailgate.ORG Server - http://www.Mailgate.ORG
References: 00-07-023
Keywords: parse, OOP

>Can Anyone Point Me In Right Direction For Writing My Own OO

Get a Smalltalk environment, and look at its compiler. All but VisualAge
include source code as far as I know. Or maybe a Java compiler like javac
or guava, though I never looked at them.

Most of them are built around an hierarchy of parse node classes. You ask
the topmost node to compile itself, then in turn it asks intermediate
node, and so on until the leaves are reached. It is in fact a complete
tree walk much like the one you'd see in any compiler -- but it is
implemented with polymorphism rather than good old switch statements.

Hope This Helps


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.