Class StructuredSwitch
- 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.StructuredSwitch
-
- All Implemented Interfaces:
HasByteCodeLoc,Matcher<StructuredStatement>,BoxingProcessor,StructuredStatement,Dumpable,TypeUsageCollectable
public class StructuredSwitch extends AbstractStructuredBlockStatement implements BoxingProcessor
-
-
Field Summary
Fields Modifier and Type Field Description private BlockIdentifierblockIdentifierprivate booleansafeExpressionprivate ExpressionswitchOn
-
Constructor Summary
Constructors Constructor Description StructuredSwitch(BytecodeLoc loc, Expression switchOn, Op04StructuredStatement body, BlockIdentifier blockIdentifier)StructuredSwitch(BytecodeLoc loc, Expression switchOn, Op04StructuredStatement body, BlockIdentifier blockIdentifier, boolean safeExpression)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidapplyNonArgExpressionRewriter(ExpressionRewriter expressionRewriter, SSAIdentifiers ssaIdentifiers, StatementContainer statementContainer, ExpressionRewriterFlags flags)voidcollectTypeUsages(TypeUsageCollector collector)Dumperdump(Dumper dumper)BlockIdentifiergetBlockIdentifier()BlockIdentifiergetBreakableBlockOrNull()BytecodeLocgetCombinedLoc()ExpressiongetSwitchOn()booleanisOnlyEmptyDefault()booleanisProperlyStructured()booleanisSafeExpression()booleanisScopeBlock()voidlinearizeInto(java.util.List<StructuredStatement> out)booleanmatch(MatchIterator<StructuredStatement> matchIterator, MatchResultCollector matchResultCollector)booleanrewriteBoxing(PrimitiveBoxingRewriter boxingRewriter)voidrewriteExpressions(ExpressionRewriter expressionRewriter)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, canDefine, canFall, claimBlock, fallsNopToNext, findCreatedHere, getContainer, getInline, getLoc, informBlockHeirachy, inlineable, isEffectivelyNOP, markCreator, setContainer, suggestName, supportsContinueBreak, toString, transformStructuredChildrenInReverse
-
-
-
-
Field Detail
-
switchOn
private Expression switchOn
-
blockIdentifier
private final BlockIdentifier blockIdentifier
-
safeExpression
private final boolean safeExpression
-
-
Constructor Detail
-
StructuredSwitch
public StructuredSwitch(BytecodeLoc loc, Expression switchOn, Op04StructuredStatement body, BlockIdentifier blockIdentifier, boolean safeExpression)
-
StructuredSwitch
public StructuredSwitch(BytecodeLoc loc, Expression switchOn, Op04StructuredStatement body, BlockIdentifier blockIdentifier)
-
-
Method Detail
-
getCombinedLoc
public BytecodeLoc getCombinedLoc()
- Specified by:
getCombinedLocin interfaceHasByteCodeLoc
-
getSwitchOn
public Expression getSwitchOn()
-
collectTypeUsages
public void collectTypeUsages(TypeUsageCollector collector)
- Specified by:
collectTypeUsagesin interfaceTypeUsageCollectable- Overrides:
collectTypeUsagesin classAbstractStructuredBlockStatement
-
getBreakableBlockOrNull
public BlockIdentifier getBreakableBlockOrNull()
- Specified by:
getBreakableBlockOrNullin interfaceStructuredStatement- Overrides:
getBreakableBlockOrNullin classAbstractStructuredStatement
-
supportsBreak
public boolean supportsBreak()
- Specified by:
supportsBreakin interfaceStructuredStatement- Overrides:
supportsBreakin classAbstractStructuredStatement
-
isProperlyStructured
public boolean isProperlyStructured()
- Specified by:
isProperlyStructuredin interfaceStructuredStatement- Overrides:
isProperlyStructuredin classAbstractStructuredStatement
-
isScopeBlock
public boolean isScopeBlock()
- Specified by:
isScopeBlockin interfaceStructuredStatement- Overrides:
isScopeBlockin classAbstractStructuredStatement
-
rewriteBoxing
public boolean rewriteBoxing(PrimitiveBoxingRewriter boxingRewriter)
- Specified by:
rewriteBoxingin interfaceBoxingProcessor
-
applyNonArgExpressionRewriter
public void applyNonArgExpressionRewriter(ExpressionRewriter expressionRewriter, SSAIdentifiers ssaIdentifiers, StatementContainer statementContainer, ExpressionRewriterFlags flags)
- Specified by:
applyNonArgExpressionRewriterin interfaceBoxingProcessor
-
getBlockIdentifier
public BlockIdentifier getBlockIdentifier()
-
linearizeInto
public void linearizeInto(java.util.List<StructuredStatement> out)
- Specified by:
linearizeIntoin interfaceStructuredStatement
-
traceLocalVariableScope
public void traceLocalVariableScope(LValueScopeDiscoverer scopeDiscoverer)
- Specified by:
traceLocalVariableScopein interfaceStructuredStatement
-
match
public boolean match(MatchIterator<StructuredStatement> matchIterator, MatchResultCollector matchResultCollector)
- Specified by:
matchin interfaceMatcher<StructuredStatement>- Overrides:
matchin classAbstractStructuredStatement
-
rewriteExpressions
public void rewriteExpressions(ExpressionRewriter expressionRewriter)
- Specified by:
rewriteExpressionsin interfaceStructuredStatement
-
isOnlyEmptyDefault
public boolean isOnlyEmptyDefault()
-
isSafeExpression
public boolean isSafeExpression()
-
-