title: How to programmatically generate .class files?
body: <p>I would like to write a compiler for a toy-language for Java. I would like to generate runnable .class files. I was wondering what is the best library or tool available for doing this? I know I could learn the binary format for all the instructions and build my own constant pool etc, but that seems like work that ought to have been already done: no point reinventing the wheel, right?</p>
  
  <p>Searching online I've found two different Java Assembly languages, <a href="http://jasmin.sourceforge.net/" rel="noreferrer">Jasmin</a> and <a href="http://judoscript.org/articles/jamaica.html" rel="noreferrer">Jamaica</a>, however only Jasmin looks somewhat maintained. </p>
  
  <p>Is there a Java library for writing byte codes to a stream? Is this what the <a href="http://commons.apache.org/bcel/" rel="noreferrer">Apache BCEL</a> is?</p>
  
  <p>Is their a tool for this that is the "standard" for byte-code generation, like Antlr is for parsing?</p>
  
  <hr>
  
  <p>PS- The toy language is <a href="http://en.wikipedia.org/wiki/Brainfuck" rel="noreferrer">Brainf***</a>, I wanted something where I could have a simple "grammar" so I could focus on the generation aspect and not the parsing part... that will come later on the next step.</p>