All Packages  Class Hierarchy  This Package  Previous  Next  Index

Interface harpoon.ClassFile.HCodeFactory

public interface HCodeFactory
An HCodeFactory makes an HCode from an HMethod. For example, an HCodeFactory may make an harpoon.IR.QuadSSA.Code from a harpoon.IR.Bytecode.Code, calling HMethod.getCode("bytecode") to get the source representation for the conversion. The HCodeFactory should call HMethod.putCode(this.getCodeName()) after conversion to cache the result.

Version:
$Id: HCodeFactory.java,v 1.4 1998/10/11 02:37:08 cananian Exp $
Author:
C. Scott Ananian <cananian@alumni.princeton.edu>

Method Index

 o convert(HMethod)
Make an HCode from an HMethod.
 o getCodeName()
Returns a string naming the type of the HCode that this factory produces.

Methods

 o convert
 public abstract HCode convert(HMethod m)
Make an HCode from an HMethod. This method should call the getCode method of m to get the source representation for the conversion. HMethod.getCode() will take care of properly caching the value convert returns.

convert is allowed to return null if the requested conversion is impossible; typically this is because it's attempt to getCode a source representation failed -- for example, because m is a native method.

 o getCodeName
 public abstract String getCodeName()
Returns a string naming the type of the HCode that this factory produces.

this.getCodeName() should equal this.convert(m).getName() for every HMethod m.


All Packages  Class Hierarchy  This Package  Previous  Next  Index