/**
* Creates a new PartialEvaluator.
* @param valueFactory the value factory that will create all
* values during evaluation.
* @param invocationUnit the invocation unit that will handle all
* communication with other fields and methods.
* @param evaluateAllCode a flag that specifies whether all branch
* targets and exception handlers should be
* evaluated, even if they are unreachable.
* @param branchUnit the branch unit that will handle all
* branches.
* @param branchTargetFinder the utility class that will find all
* branches.
*/
private PartialEvaluator(ValueFactory valueFactory,
InvocationUnit invocationUnit,
boolean evaluateAllCode,
BasicBranchUnit branchUnit,
BranchTargetFinder branchTargetFinder,
java.util.Stack callingInstructionBlockStack)
{
this.valueFactory = valueFactory;
this.invocationUnit = invocationUnit;
this.evaluateAllCode = evaluateAllCode;
this.branchUnit = branchUnit;
this.branchTargetFinder = branchTargetFinder;
this.callingInstructionBlockStack = callingInstructionBlockStack == null ?
this.instructionBlockStack :
callingInstructionBlockStack;
}
/**
* Creates a new PartialEvaluator.
* @param valueFactory the value factory that will create all values
* during evaluation.
* @param invocationUnit the invocation unit that will handle all
* communication with other fields and methods.
* @param evaluateAllCode a flag that specifies whether all branch targets
* and exception handlers should be evaluated,
* even if they are unreachable.
*/
public PartialEvaluator(ValueFactory valueFactory,
InvocationUnit invocationUnit,
boolean evaluateAllCode)
{
this(valueFactory,
invocationUnit,
evaluateAllCode,
evaluateAllCode ?
new BasicBranchUnit() :
new TracedBranchUnit(),
new BranchTargetFinder(),
null);
}