Class StructuredFor
- java.lang.Object
-
- org.benf.cfr.reader.bytecode.analysis.structured.statement.AbstractStructuredStatement
-
- org.benf.cfr.reader.bytecode.analysis.structured.statement.AbstractStructuredBlockStatement
-
- org.benf.cfr.reader.bytecode.analysis.structured.statement.StructuredFor
-
- All Implemented Interfaces:
HasByteCodeLoc
,Matcher<StructuredStatement>
,StructuredStatement
,Dumpable
,TypeUsageCollectable
public class StructuredFor extends AbstractStructuredBlockStatement
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.List<AbstractAssignmentExpression>
assignments
private BlockIdentifier
block
private ConditionalExpression
condition
private AssignmentSimple
initial
private boolean
isCreator
-
Constructor Summary
Constructors Constructor Description StructuredFor(BytecodeLoc loc, ConditionalExpression condition, AssignmentSimple initial, java.util.List<AbstractAssignmentExpression> assignments, Op04StructuredStatement body, BlockIdentifier block)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
canDefine(LValue scopedEntity, ScopeDiscoverInfoCache factCache)
void
collectTypeUsages(TypeUsageCollector collector)
Dumper
dump(Dumper dumper)
java.util.List<LValue>
findCreatedHere()
BlockIdentifier
getBlock()
BlockIdentifier
getBreakableBlockOrNull()
BytecodeLoc
getCombinedLoc()
boolean
isScopeBlock()
void
linearizeInto(java.util.List<StructuredStatement> out)
void
markCreator(LValue scopedEntity, StatementContainer<StructuredStatement> hint)
boolean
match(MatchIterator<StructuredStatement> matchIterator, MatchResultCollector matchResultCollector)
void
rewriteExpressions(ExpressionRewriter expressionRewriter)
java.lang.String
suggestName(LocalVariable createdHere, Predicate<java.lang.String> testNameUsedFn)
boolean
supportsBreak()
void
traceLocalVariableScope(LValueScopeDiscoverer scopeDiscoverer)
-
Methods inherited from class org.benf.cfr.reader.bytecode.analysis.structured.statement.AbstractStructuredBlockStatement
getBody, isRecursivelyStructured, transformStructuredChildren
-
Methods inherited from class org.benf.cfr.reader.bytecode.analysis.structured.statement.AbstractStructuredStatement
addLoc, alwaysDefines, canFall, claimBlock, fallsNopToNext, getContainer, getInline, getLoc, informBlockHeirachy, inlineable, isEffectivelyNOP, isProperlyStructured, setContainer, supportsContinueBreak, toString, transformStructuredChildrenInReverse
-
-
-
-
Field Detail
-
condition
private ConditionalExpression condition
-
initial
private AssignmentSimple initial
-
assignments
private java.util.List<AbstractAssignmentExpression> assignments
-
block
private final BlockIdentifier block
-
isCreator
private boolean isCreator
-
-
Constructor Detail
-
StructuredFor
public StructuredFor(BytecodeLoc loc, ConditionalExpression condition, AssignmentSimple initial, java.util.List<AbstractAssignmentExpression> assignments, Op04StructuredStatement body, BlockIdentifier block)
-
-
Method Detail
-
collectTypeUsages
public void collectTypeUsages(TypeUsageCollector collector)
- Specified by:
collectTypeUsages
in interfaceTypeUsageCollectable
- Overrides:
collectTypeUsages
in classAbstractStructuredBlockStatement
-
getCombinedLoc
public BytecodeLoc getCombinedLoc()
-
isScopeBlock
public boolean isScopeBlock()
- Specified by:
isScopeBlock
in interfaceStructuredStatement
- Overrides:
isScopeBlock
in classAbstractStructuredStatement
-
linearizeInto
public void linearizeInto(java.util.List<StructuredStatement> out)
-
getBreakableBlockOrNull
public BlockIdentifier getBreakableBlockOrNull()
- Specified by:
getBreakableBlockOrNull
in interfaceStructuredStatement
- Overrides:
getBreakableBlockOrNull
in classAbstractStructuredStatement
-
supportsBreak
public boolean supportsBreak()
- Specified by:
supportsBreak
in interfaceStructuredStatement
- Overrides:
supportsBreak
in classAbstractStructuredStatement
-
traceLocalVariableScope
public void traceLocalVariableScope(LValueScopeDiscoverer scopeDiscoverer)
-
markCreator
public void markCreator(LValue scopedEntity, StatementContainer<StructuredStatement> hint)
- Specified by:
markCreator
in interfaceStructuredStatement
- Overrides:
markCreator
in classAbstractStructuredStatement
-
canDefine
public boolean canDefine(LValue scopedEntity, ScopeDiscoverInfoCache factCache)
- Specified by:
canDefine
in interfaceStructuredStatement
- Overrides:
canDefine
in classAbstractStructuredStatement
-
findCreatedHere
public java.util.List<LValue> findCreatedHere()
- Specified by:
findCreatedHere
in interfaceStructuredStatement
- Overrides:
findCreatedHere
in classAbstractStructuredStatement
-
suggestName
public java.lang.String suggestName(LocalVariable createdHere, Predicate<java.lang.String> testNameUsedFn)
- Specified by:
suggestName
in interfaceStructuredStatement
- Overrides:
suggestName
in classAbstractStructuredStatement
-
rewriteExpressions
public void rewriteExpressions(ExpressionRewriter expressionRewriter)
-
getBlock
public BlockIdentifier getBlock()
-
match
public boolean match(MatchIterator<StructuredStatement> matchIterator, MatchResultCollector matchResultCollector)
- Specified by:
match
in interfaceMatcher<StructuredStatement>
- Overrides:
match
in classAbstractStructuredStatement
-
-