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>assignmentsprivate BlockIdentifierblockprivate ConditionalExpressionconditionprivate AssignmentSimpleinitialprivate booleanisCreator
-
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 booleancanDefine(LValue scopedEntity, ScopeDiscoverInfoCache factCache)voidcollectTypeUsages(TypeUsageCollector collector)Dumperdump(Dumper dumper)java.util.List<LValue>findCreatedHere()BlockIdentifiergetBlock()BlockIdentifiergetBreakableBlockOrNull()BytecodeLocgetCombinedLoc()booleanisScopeBlock()voidlinearizeInto(java.util.List<StructuredStatement> out)voidmarkCreator(LValue scopedEntity, StatementContainer<StructuredStatement> hint)booleanmatch(MatchIterator<StructuredStatement> matchIterator, MatchResultCollector matchResultCollector)voidrewriteExpressions(ExpressionRewriter expressionRewriter)java.lang.StringsuggestName(LocalVariable createdHere, Predicate<java.lang.String> testNameUsedFn)booleansupportsBreak()voidtraceLocalVariableScope(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:
collectTypeUsagesin interfaceTypeUsageCollectable- Overrides:
collectTypeUsagesin classAbstractStructuredBlockStatement
-
getCombinedLoc
public BytecodeLoc getCombinedLoc()
-
isScopeBlock
public boolean isScopeBlock()
- Specified by:
isScopeBlockin interfaceStructuredStatement- Overrides:
isScopeBlockin classAbstractStructuredStatement
-
linearizeInto
public void linearizeInto(java.util.List<StructuredStatement> out)
-
getBreakableBlockOrNull
public BlockIdentifier getBreakableBlockOrNull()
- Specified by:
getBreakableBlockOrNullin interfaceStructuredStatement- Overrides:
getBreakableBlockOrNullin classAbstractStructuredStatement
-
supportsBreak
public boolean supportsBreak()
- Specified by:
supportsBreakin interfaceStructuredStatement- Overrides:
supportsBreakin classAbstractStructuredStatement
-
traceLocalVariableScope
public void traceLocalVariableScope(LValueScopeDiscoverer scopeDiscoverer)
-
markCreator
public void markCreator(LValue scopedEntity, StatementContainer<StructuredStatement> hint)
- Specified by:
markCreatorin interfaceStructuredStatement- Overrides:
markCreatorin classAbstractStructuredStatement
-
canDefine
public boolean canDefine(LValue scopedEntity, ScopeDiscoverInfoCache factCache)
- Specified by:
canDefinein interfaceStructuredStatement- Overrides:
canDefinein classAbstractStructuredStatement
-
findCreatedHere
public java.util.List<LValue> findCreatedHere()
- Specified by:
findCreatedHerein interfaceStructuredStatement- Overrides:
findCreatedHerein classAbstractStructuredStatement
-
suggestName
public java.lang.String suggestName(LocalVariable createdHere, Predicate<java.lang.String> testNameUsedFn)
- Specified by:
suggestNamein interfaceStructuredStatement- Overrides:
suggestNamein classAbstractStructuredStatement
-
rewriteExpressions
public void rewriteExpressions(ExpressionRewriter expressionRewriter)
-
getBlock
public BlockIdentifier getBlock()
-
match
public boolean match(MatchIterator<StructuredStatement> matchIterator, MatchResultCollector matchResultCollector)
- Specified by:
matchin interfaceMatcher<StructuredStatement>- Overrides:
matchin classAbstractStructuredStatement
-
-