Skip to content

Embedding the assembler

toby1984 edited this page May 12, 2012 · 3 revisions

jASM comes with fairly complete javadocs (although parsing and the way the AST works definitely need some more explanation...) , the best starting point is probably my debugging tool 'ASTInspector'.

Basically, the ASTInspector is a IDE without all the fancy features and a 'save' button.

The features included are:

  • automatic recompilation after changes to the source code
  • syntax/semantic highlighting
  • error highlighting
  • navigation from source code location to AST nodes and vice versa
  • stopping compilation after a specific compilation phase to inspect the generated AST (especially handy when debugging expression folding and other AST transformations)

Running ASTInspector

You can run the application by either doing java -classpath jasm16.jar de.codesourcery.jasm16.utils.ASTInspector [ ASM source file] or ( if you cloned my git repo) by invoking mvn exec:java

See below for some screenshots.

Embedding the compiler

To get started, here's a little 'Hello world' example.

Screenshots

ASTInspector 1

ASTInspector 2