ptolemy.copernicus.java
Class InlineParameterTransformer

java.lang.Object
  extended by soot.Transformer
      extended by soot.SceneTransformer
          extended by ptolemy.copernicus.java.InlineParameterTransformer
All Implemented Interfaces:
soot.HasPhaseOptions

public class InlineParameterTransformer
extends soot.SceneTransformer
implements soot.HasPhaseOptions

A Transformer that is responsible for inlining the values of parameters and settable attributes. The values of the parameters are taken from the model specified for this transformer. This transformer replaces a parameter with a field that points to a properly initialized token that contains the value of the parameter. Settable attributes other than parameters are handled similarly and are replaces with their expression. This transformer also properly inlines code from the attribute changed method that handles the change of any parameter values.

Since:
Ptolemy II 2.0
Version:
$Id: InlineParameterTransformer.java,v 1.105 2008/01/26 00:47:32 cxh Exp $
Author:
Stephen Neuendorffer
Accepted Rating:
Red (cxh)
Proposed Rating:
Red (cxh)

Method Summary
 soot.SootField _findAttributeField(soot.SootClass entityClass, java.lang.String name)
           
 soot.Local getAttributeContainerRef(Entity container, soot.SootMethod method, soot.Local local, soot.Unit location, soot.toolkits.scalar.LocalDefs localDefs, soot.toolkits.scalar.LocalUses localUses, soot.Unit insertPoint)
           
static Attribute getAttributeValue(soot.SootMethod method, soot.Local local, soot.Unit location, soot.toolkits.scalar.LocalDefs localDefs, soot.toolkits.scalar.LocalUses localUses)
          Attempt to determine the constant value of the given local, which is assumed to have a variable type.
 java.lang.String getDeclaredOptions()
           
 java.lang.String getDefaultOptions()
           
 java.lang.String getPhaseName()
           
protected  void internalTransform(java.lang.String phaseName, java.util.Map options)
           
static InlineParameterTransformer v(CompositeActor model)
          Return an instance of this transformer that will operate on the given model.
 
Methods inherited from class soot.SceneTransformer
transform, transform, transform
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

v

public static InlineParameterTransformer v(CompositeActor model)
Return an instance of this transformer that will operate on the given model. The model is assumed to already have been properly initialized so that resolved types and other static properties of the model can be inspected.


getPhaseName

public java.lang.String getPhaseName()
Specified by:
getPhaseName in interface soot.HasPhaseOptions

getDefaultOptions

public java.lang.String getDefaultOptions()
Specified by:
getDefaultOptions in interface soot.HasPhaseOptions

getDeclaredOptions

public java.lang.String getDeclaredOptions()
Specified by:
getDeclaredOptions in interface soot.HasPhaseOptions

internalTransform

protected void internalTransform(java.lang.String phaseName,
                                 java.util.Map options)
Specified by:
internalTransform in class soot.SceneTransformer

getAttributeContainerRef

public soot.Local getAttributeContainerRef(Entity container,
                                           soot.SootMethod method,
                                           soot.Local local,
                                           soot.Unit location,
                                           soot.toolkits.scalar.LocalDefs localDefs,
                                           soot.toolkits.scalar.LocalUses localUses,
                                           soot.Unit insertPoint)

getAttributeValue

public static Attribute getAttributeValue(soot.SootMethod method,
                                          soot.Local local,
                                          soot.Unit location,
                                          soot.toolkits.scalar.LocalDefs localDefs,
                                          soot.toolkits.scalar.LocalUses localUses)
Attempt to determine the constant value of the given local, which is assumed to have a variable type. Walk backwards through all the possible places that the local may have been defined and try to symbolically evaluate the value of the variable. If the value can be determined, then return it, otherwise throw an exception


_findAttributeField

public soot.SootField _findAttributeField(soot.SootClass entityClass,
                                          java.lang.String name)