Search code examples
javacompiler-constructionbytecode

From intermediate code to Java bytecode (dragon book)


I'm enrolled in a compilers course, using the "dragon book" as textbook. It gives instructions on how to convert the intermediate code generated by its compiler to an object language, assembly.

My question is: where can I find instructions to convert an intermediate code in the 3-address format to java bytecode, for the same grammar used in the book?

Textbook site: http://dragonbook.stanford.edu/index.html#courses


Solution

  • If you want to know how to create a binary Java classfile yourself, there's no better resource than the official JVM specification.

    If you want to write a classfile in a human readable textual format, there are various assemblers available: Krakatau, Jasmin, and Lilac among others. Note that Jasmin is old and largely unmaintained, though the Sable Research Group maintains a fork of it for use with their own tools.