forge.transform
Class AbstractTransformer

java.lang.Object
  extended by forge.transform.AbstractTransformer
All Implemented Interfaces:
Transformer
Direct Known Subclasses:
InlineTransformer

public abstract class AbstractTransformer
extends java.lang.Object
implements Transformer

Implementation support for a transformer of a single call graph.

Author:
Greg Dennis (gdennis@mit.edu)

Nested Class Summary
protected static class AbstractTransformer.TransformVisitor
          A TransformVisitor
 
Field Summary
 
Fields inherited from interface forge.transform.Transformer
IDENTITY
 
Constructor Summary
protected AbstractTransformer()
          Constructs a transformer with a tag that will be appended to each transformed procedure.
 
Method Summary
 CFGStmt sourceStmt(CFGStmt targetStmt)
          Returns the source update from which the given target was transformed.
 ForgeCFG transform(ForgeCFG source)
          Checks in the cache whether or not the procedure has already been transformed.
protected abstract  AbstractTransformer.TransformVisitor visitor(ForgeCFG source)
          Returns a TransformVisitor that converts source.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractTransformer

protected AbstractTransformer()
Constructs a transformer with a tag that will be appended to each transformed procedure. Specifically, if the original procedure is named "x", the transformed procedure will be named "x_tag".

Method Detail

transform

public final ForgeCFG transform(ForgeCFG source)
Checks in the cache whether or not the procedure has already been transformed. If it has, returns the transformed version. If not, calls makeTarget, caches the source procedure to the target, and then calls transform(source, target).

Specified by:
transform in interface Transformer

sourceStmt

public final CFGStmt sourceStmt(CFGStmt targetStmt)
Description copied from interface: Transformer
Returns the source update from which the given target was transformed.

Specified by:
sourceStmt in interface Transformer

visitor

protected abstract AbstractTransformer.TransformVisitor visitor(ForgeCFG source)
Returns a TransformVisitor that converts source.