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 BlockIdentifier
blockIdentifier
private boolean
safeExpression
private Expression
switchOn
-
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 void
applyNonArgExpressionRewriter(ExpressionRewriter expressionRewriter, SSAIdentifiers ssaIdentifiers, StatementContainer statementContainer, ExpressionRewriterFlags flags)
void
collectTypeUsages(TypeUsageCollector collector)
Dumper
dump(Dumper dumper)
BlockIdentifier
getBlockIdentifier()
BlockIdentifier
getBreakableBlockOrNull()
BytecodeLoc
getCombinedLoc()
Expression
getSwitchOn()
boolean
isOnlyEmptyDefault()
boolean
isProperlyStructured()
boolean
isSafeExpression()
boolean
isScopeBlock()
void
linearizeInto(java.util.List<StructuredStatement> out)
boolean
match(MatchIterator<StructuredStatement> matchIterator, MatchResultCollector matchResultCollector)
boolean
rewriteBoxing(PrimitiveBoxingRewriter boxingRewriter)
void
rewriteExpressions(ExpressionRewriter expressionRewriter)
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, 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:
getCombinedLoc
in interfaceHasByteCodeLoc
-
getSwitchOn
public Expression getSwitchOn()
-
collectTypeUsages
public void collectTypeUsages(TypeUsageCollector collector)
- Specified by:
collectTypeUsages
in interfaceTypeUsageCollectable
- Overrides:
collectTypeUsages
in classAbstractStructuredBlockStatement
-
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
-
isProperlyStructured
public boolean isProperlyStructured()
- Specified by:
isProperlyStructured
in interfaceStructuredStatement
- Overrides:
isProperlyStructured
in classAbstractStructuredStatement
-
isScopeBlock
public boolean isScopeBlock()
- Specified by:
isScopeBlock
in interfaceStructuredStatement
- Overrides:
isScopeBlock
in classAbstractStructuredStatement
-
rewriteBoxing
public boolean rewriteBoxing(PrimitiveBoxingRewriter boxingRewriter)
- Specified by:
rewriteBoxing
in interfaceBoxingProcessor
-
applyNonArgExpressionRewriter
public void applyNonArgExpressionRewriter(ExpressionRewriter expressionRewriter, SSAIdentifiers ssaIdentifiers, StatementContainer statementContainer, ExpressionRewriterFlags flags)
- Specified by:
applyNonArgExpressionRewriter
in interfaceBoxingProcessor
-
getBlockIdentifier
public BlockIdentifier getBlockIdentifier()
-
linearizeInto
public void linearizeInto(java.util.List<StructuredStatement> out)
- Specified by:
linearizeInto
in interfaceStructuredStatement
-
traceLocalVariableScope
public void traceLocalVariableScope(LValueScopeDiscoverer scopeDiscoverer)
- Specified by:
traceLocalVariableScope
in interfaceStructuredStatement
-
match
public boolean match(MatchIterator<StructuredStatement> matchIterator, MatchResultCollector matchResultCollector)
- Specified by:
match
in interfaceMatcher<StructuredStatement>
- Overrides:
match
in classAbstractStructuredStatement
-
rewriteExpressions
public void rewriteExpressions(ExpressionRewriter expressionRewriter)
- Specified by:
rewriteExpressions
in interfaceStructuredStatement
-
isOnlyEmptyDefault
public boolean isOnlyEmptyDefault()
-
isSafeExpression
public boolean isSafeExpression()
-
-