|Compiler construction in C++ and OOD email@example.com (1993-02-03)|
|Re: Compiler construction in C++ and OOD firstname.lastname@example.org (1993-02-04)|
|Re: Compiler construction in C++ and OOD email@example.com (1993-02-08)|
|From:||firstname.lastname@example.org (Stefan Vaillant)|
|Organization:||Rechnerbetrieb Informatik - RWTH Aachen|
|Date:||Mon, 8 Feb 1993 18:22:36 GMT|
email@example.com (Vivek Buzruk) writes:
>I will be happy if any one tells whether any complete compiler is written
>in C++ either. Also in what way C++ is used, only as a better C or flavor
Sather, an Eiffel dialect, is implemented with object-orientation in mind.
The compiler is written in Sather (of course), but IMHO it is worth having
a look at it, even if you are interesseted in C++.
The compiler has the following structure: The front-end is written in
yacc. The action-parts construct an abstract syntax tree. Each node of
this tree is an object and has an individual interface. For example, the
node which represents the IF-statement has the following attributes:
class COND_STMTOB is
test: EXPREOB; -- reference to expression node
then_part: LST_STMTOB; -- List of statements
Every node (or object) has some methods for doing a semantic check and for
generating code. (This is not quite correct. I had only a quick look at
one year ago.)
You can obtain sather (incl. source code of the compiler) from
IMHO this is not totally new, but clean and easy to understand.
You might also have a look at
- the book of Rumbaugh et. all. "Object Oriented Modeling and Design".
They have some examples with syntax trees representing
- the Eiffel scanner/parser library.
Return to the
Search the comp.compilers archives again.