Executing tiny programming language compiled byte code with the JVM

Hello,

For a project, I am developing a simple programming language, with a syntax not unlike Pascal, which compiles to Java Byte Code. Currently I execute the compiled byte code using my own interpreter. This works OK, but what I'd like to do now is to execute the compiled byte code using the actual existing JVM. The compiled byte code resides in a text file upon compilation of a sample program written in my tiny programming language. Does anyone know how I may start to go about this? Thanks in advance.

adam

[534 byte] By [adamcuza] at [2007-11-26 18:57:10]
# 1

The only way of getting a standard Java virtual machine to execute your java byte code, is to wrap it up into a completely valid java class file.

Any constants you use, must be put into the classes constant pool.

Any local variables will have to go into the local variable table of the method which uses them... etc, etc.

Something like ASM, would let you dynamically create a Java class file.

http://asm.objectweb.org/

regards,

Owen

omcgoverna at 2007-7-9 20:36:30 > top of Java-index,Java HotSpot Virtual Machine,Specifications...