|object oriented compiler/interpreter - HOWTO bretr_a@--nospam--one.net.au (Brett) (2000-07-18)|
|Re: object oriented compiler/interpreter-HOWTO email@example.com (2000-07-23)|
|From:||firstname.lastname@example.org (Paolo Bonzini)|
|Date:||23 Jul 2000 16:54:13 -0400|
|Organization:||Mailgate.ORG Server - http://www.Mailgate.ORG|
>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
Return to the
Search the comp.compilers archives again.