best doc for the compiler I wrote? (PPAATT)
31 Oct 1999 01:20:46 -0400

          From comp.compilers

Related articles
best doc for the compiler I wrote? (1999-10-31)
| List of all articles for this month |

From: (PPAATT)
Newsgroups: comp.compilers
Date: 31 Oct 1999 01:20:46 -0400
Organization: AOL
Keywords: C, documentation

Has noone yet placed on the web a delightfully intelligible presentation of a
whole compiler for a C-like language?

I find people here last said "no" in 1996? I checked:


I find complete info only hidden away in paper books that cost money?
Given that I have to encourage the continued production of paper
books, am I best off with comp.compilers.lcc?

I ask because I'm trying to write, on the side at home, a Java
expression compiler. In the end, I want to make .html SCRIPT
LANGUAGE=Java to work with any browser >= JDK 1.1. However, working
on the side at home, I'm failing to remain focused enough to keep the
whole structure of such a program fully memorised. To do all Java 1.0
expressions, I now have roughly 75 classes coded in 750KB of source
and commentary. For me, too much to remember if I ignore it for a
month or two.

I'm now seriously considering the (I know, extreme) choice of actually
documenting the structure of my program. (I might instead/in-addition
for each .class write exhaustive self-checking tests in .html;
meanwhile ...)

If I could plagiarise an organised presentation of a WHOLE compiler
then maybe even in my spare time I could put together something that
just plain works?

As is, my code mostly falls down out where the Java Language
Specification makes unhelpful remarks like "a later stage of compiler
analysis then sorts out the precise ...". Troubles analogous to how a
C compiler realises (int)+1 is a type cast rather than an addition. I
think the lexer and parser are ok. I'm dying only out where I lack a
formal specification for what I want to have happen.

For example, it took me HOURS to clue in that the Microsoft class
loaders behave differently when called via java.lang.reflect. I had
flatly failed to preconceive that such an abomination was possible - I
had no test written to preclude it. And I know I've walked down some
blind alleys more than once - for example, while wrestling with how to
make sense of such things as the 14 chars of the invalid source
fragment "struct...field". So I ask ...

Has noone yet placed on the web a delightfully intelligible
presentation of a whole compiler for a C-like language?

Thanks in advance.

Pat LaVarre

Post a followup to this message

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