MilkTea: Simplified C to Java Assembly (Oolong) Compiler
By H.-T. Lin and
C.-Y Wu, 1999.
Introduction
MilkTea is a Simplified C to Java Assembly (Oolong) Compiler. It is the final
project of the Compiler class that C.-Y Wu
and I wrote in our junior year. We removed some features of C
to make our works easier, while trying to finish as many
important parts as possible.
We did not have time to write full-documentation about this project, but
we still
welcome any further discussion about what we have or have not done.
We use flex and bison to create this compiler. If you want to try
our source code, you will need to find these two programs.
Features
- Features that are differenct from C
- ++ and -- are not supported
- Macro preprocessors are not supported
- Basic I/O are supported by predefined function names
- Pointer declaration are different from C. int* a, b
means a and b both points to an integer.
- Structure declarations are C++-like. typedef is not
supported.
- Some others will be added as soon as I recall them.
- Features that are important
- C-type assignment, which treats assignment as
expression, is preserved
- Basic operations(+, -, etc) are evaluated on the
stack of JVM rather than storing them in a local variable.
- Structures are encoded to java classes.
- Some others will be added as soon as I recall them.
Feel free to contact me: "htlin" at "csie.ntu.edu.tw"