dk.brics.xact.analysis.soot
Class TranslatorContext

java.lang.Object
  extended by dk.brics.xact.analysis.soot.TranslatorContext

public class TranslatorContext
extends Object

Context for producing flow graph statements. This is simple storage with no actual functionality.


Constructor Summary
TranslatorContext(StringAnalysis sa, Hierarchy h)
          Constructs a new translator context.
 
Method Summary
 Value getAliasValue()
          Returns the alias variable for assignment to and from nonimportant types.
 SootClass getCurrentClass()
          Returns the current class.
 int getCurrentLine()
          Returns the current line number.
 SootMethod getCurrentMethod()
          Returns the current method.
 Origin getCurrentOrigin()
          Returns the current origin.
 Hierarchy getHierarchy()
          Returns the class hierarchy.
 Map<Statement,SootMethod> getInvokeMethodMap()
          Returns map from invoke statement to containing Soot method.
 Map<Stmt,Map<Integer,Variable>> getInvokeParamMaps()
          Returns map from invoke sites to map from parameter indices to graph variables.
 Map<Statement,Stmt> getInvokeStatementMap()
          Returns map from abstract invoke site to Soot invoke stmt.
 Statement getLastStatement()
          Returns the last statement from the statement queue.
 Map<Local,String> getLocalStrings()
          Returns the map from local variables to the last constant string assigned to them.
 Map<SootMethod,Map<Integer,Variable>> getMethodParamMaps()
          Returns map from methods to map from parameter indices to graph variables.
 Map<SootMethod,Collection<Statement>> getMethodReturns()
          Returns map from Soot method to collection of graph return points.
 Value getMethodReturnVar()
          Returns the current method return variable.
 Map<String,String> getNamespaces()
          Returns the namespace declaration map (from prefix to URI).
 Statement getNextStatement()
          Returns the next statement from the statement queue.
 int getNextVarID()
          Returns the next fresh variable ID.
 Map<Integer,Variable> getParamMap()
          Returns the map from parameter indices of the current method to graph variables.
 Map<ParameterRef,SootMethod> getParamRefMap()
          Returns the map from Soot parameter references to corresponding Soot methods.
 Value getResultVar()
          Returns the result variable for the current method invocation.
 StringAnalysis getStringAnalysis()
          Returns the string analysis for querying possible values at string plugs etc.
 Map<String,Variable> getVarMap()
          Returns the map from Soot field/local/dummy variable descriptor strings to graph variables.
 void initParamMap()
          Initializes the map from parameter indices to flow graph variables.
 boolean moreStatements()
          Returns true if the queue of generated statements is nonempty.
 void putStatement(Statement s)
          Adds a statement to the queue.
 void setCurrentClass(SootClass c)
          Sets the current class.
 void setCurrentLine(int line)
          Sets the current line number.
 void setCurrentMethod(SootMethod m)
          Sets the current method.
 void setCurrentOrigin(Origin o)
          Sets the current origin.
 void setMethodReturnVar(Value var)
          Sets the current method return variable.
 void setResultVar(Value v)
          Sets the result variable for the current method invocation.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TranslatorContext

public TranslatorContext(StringAnalysis sa,
                         Hierarchy h)
Constructs a new translator context.

Method Detail

getAliasValue

public Value getAliasValue()
Returns the alias variable for assignment to and from nonimportant types. This a single global variable of type XML[].


getCurrentClass

public SootClass getCurrentClass()
Returns the current class.


getCurrentLine

public int getCurrentLine()
Returns the current line number.


getCurrentMethod

public SootMethod getCurrentMethod()
Returns the current method.


getCurrentOrigin

public Origin getCurrentOrigin()
Returns the current origin.


getHierarchy

public Hierarchy getHierarchy()
Returns the class hierarchy.


getInvokeMethodMap

public Map<Statement,SootMethod> getInvokeMethodMap()
Returns map from invoke statement to containing Soot method.


getInvokeParamMaps

public Map<Stmt,Map<Integer,Variable>> getInvokeParamMaps()
Returns map from invoke sites to map from parameter indices to graph variables.


getInvokeStatementMap

public Map<Statement,Stmt> getInvokeStatementMap()
Returns map from abstract invoke site to Soot invoke stmt.


getLastStatement

public Statement getLastStatement()
Returns the last statement from the statement queue.


getLocalStrings

public Map<Local,String> getLocalStrings()
Returns the map from local variables to the last constant string assigned to them.


getMethodParamMaps

public Map<SootMethod,Map<Integer,Variable>> getMethodParamMaps()
Returns map from methods to map from parameter indices to graph variables.


getMethodReturns

public Map<SootMethod,Collection<Statement>> getMethodReturns()
Returns map from Soot method to collection of graph return points.


getMethodReturnVar

public Value getMethodReturnVar()
Returns the current method return variable.


getNamespaces

public Map<String,String> getNamespaces()
Returns the namespace declaration map (from prefix to URI).


getNextStatement

public Statement getNextStatement()
Returns the next statement from the statement queue.


getNextVarID

public int getNextVarID()
Returns the next fresh variable ID.


getParamMap

public Map<Integer,Variable> getParamMap()
Returns the map from parameter indices of the current method to graph variables.


getParamRefMap

public Map<ParameterRef,SootMethod> getParamRefMap()
Returns the map from Soot parameter references to corresponding Soot methods.


getResultVar

public Value getResultVar()
Returns the result variable for the current method invocation.


getStringAnalysis

public StringAnalysis getStringAnalysis()
Returns the string analysis for querying possible values at string plugs etc.


getVarMap

public Map<String,Variable> getVarMap()
Returns the map from Soot field/local/dummy variable descriptor strings to graph variables.


initParamMap

public void initParamMap()
Initializes the map from parameter indices to flow graph variables.


moreStatements

public boolean moreStatements()
Returns true if the queue of generated statements is nonempty.


putStatement

public void putStatement(Statement s)
Adds a statement to the queue.


setCurrentClass

public void setCurrentClass(SootClass c)
Sets the current class.


setCurrentLine

public void setCurrentLine(int line)
Sets the current line number.


setCurrentMethod

public void setCurrentMethod(SootMethod m)
Sets the current method.


setCurrentOrigin

public void setCurrentOrigin(Origin o)
Sets the current origin.


setMethodReturnVar

public void setMethodReturnVar(Value var)
Sets the current method return variable.


setResultVar

public void setResultVar(Value v)
Sets the result variable for the current method invocation.



Copyright © 2005-2008 Aarhus University.