pnuts.compiler
Class FileWriterHandler

java.lang.Object
  |
  +--pnuts.compiler.FileWriterHandler
All Implemented Interfaces:
ClassFileHandler

public class FileWriterHandler
extends java.lang.Object
implements ClassFileHandler

This class is a concrete class of ClassFileHandler. When this is passed to Compiler.compile(..., ClassFileHandler), compiled class files are saved in the directory specified with the constructor.


Constructor Summary
FileWriterHandler(java.io.File dir)
           
 
Method Summary
 java.lang.Object getResult(CompileContext cc)
          This method is called when all class files are handled.
 void handle(CompileContext cc, ClassFile cf)
          This method is called with each compiled class file when Compiler.compile(Pnuts, ClassFileHandler) method is called.
 void setVerbose(boolean flag)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FileWriterHandler

public FileWriterHandler(java.io.File dir)
Method Detail

setVerbose

public void setVerbose(boolean flag)

handle

public void handle(CompileContext cc,
                   ClassFile cf)
Description copied from interface: ClassFileHandler
This method is called with each compiled class file when Compiler.compile(Pnuts, ClassFileHandler) method is called. The first class file is supposed to be of pnuts.lang.Runtime subclass. The compiled code can be executed with Runtime.execute(Context) method.
Specified by:
handle in interface ClassFileHandler

getResult

public java.lang.Object getResult(CompileContext cc)
Description copied from interface: ClassFileHandler
This method is called when all class files are handled. The returned object will be the result of the method call, Compiler.compile(Pnuts, ClassFileHandler).
Specified by:
getResult in interface ClassFileHandler