Compiler Construction with ANTLR and Java

By Gary L. Schaps

Dr. Dobb's Journal March 1999

try {
    DataOutputStream out = new DataOutputStream(
      new FileOutputStream(
      patFile.substring(0, patFile.length() - 3) + "pbi"));
    // generate code
    PBIWriter writer = new PBIWriter();
    writer.generateCode(out);
} catch(IOException ex) {
      ...
}

Example 5: Creating a binary output file.

Back to Article


Copyright © 1999, Dr. Dobb's Journal