Next:
The Java Virtual
Up:
Compiling Pascal to Java
Previous:
Preface
Contents
Preface
The Java Virtual Machine
Introduction
Internals of the JVM
Types
Primitive Types
Reference Types
Runtime Data Areas
Frames
The Java Class File Format
The Class File Structure
Fields in a Class File
The JVM Instruction Set
Typed Instructions
The Instruction Set
Load Instructions
Store Instructions
Arithmetic Instructions
Conversion Instructions
Class Instances and Array Instructions
Stack Manipulation Instructions
Branch and Comparison Instructions
Method Instructions
Miscellaneous Instructions
Descriptors
Field Descriptors
Method Descriptors
Compiling Pascal
The Project
Translating EM to Java Bytecode
C as Source Language
Pascal as Source Language
Problems and Solutions
Starting Out
How to Store a Class File
Datastructures to Hold the Class File
The Empty Program
Initial constant_pool[] Entries
<init>
main
Fit it in the Compiler
Declarations
Variable and Constant Declarations
Variables and Constants as ``Normal'' Java Fields
Variables and Constants as Objects or Arrays
The Problem with Local Variables
Procedure and Function Declarations
How to Compile a Procedure or Function
Parameters
Statements
Maintaining the Size of the Operand Stack
Expressions
Constant Values
Variable Values
Unary Operators
Binary Operators
Arithmetic operators
Comparison Operators
Boolean Operators
Assignments
Procedure and Function Calls
write and writeln Statements
Control Statements
If Then Else
Other Conditional Statements
While
Repeat
For
Case
Function Returns
Things Left To Do
Records
Pointers
goto Statements
Final Remarks
Conclusion
Personal Experience
Acknowledgments
An Example Program
Pascal Source Code
Java Class File
jdisco Output
D-Java Output
References
About this document ...
mark@bottom.xs4all.nl