Class ScopeEscapeHoister
- java.lang.Object
-
- com.tonic.analysis.source.ast.transform.ScopeEscapeHoister
-
- All Implemented Interfaces:
ASTTransform
public class ScopeEscapeHoister extends Object implements ASTTransform
Repairs declarations whose variable escapes its block.
-
-
Constructor Summary
Constructors Constructor Description ScopeEscapeHoister()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetName()voidsetNonLocalName(Predicate<String> nonLocalName)Sets the test for names that must never be given a manufactured declaration.booleantransform(BlockStmt block)Transforms the given block statement in place.
-
-
-
Method Detail
-
setNonLocalName
public void setNonLocalName(Predicate<String> nonLocalName)
Sets the test for names that must never be given a manufactured declaration.- Parameters:
nonLocalName- returns true for parameters and field names
-
getName
public String getName()
- Specified by:
getNamein interfaceASTTransform- Returns:
- the name of this transform for logging/debugging
-
transform
public boolean transform(BlockStmt block)
Description copied from interface:ASTTransformTransforms the given block statement in place.- Specified by:
transformin interfaceASTTransform- Parameters:
block- the block to transform- Returns:
- true if any changes were made
-
-