Class SwitchExpressionRewriter
- java.lang.Object
-
- org.benf.cfr.reader.bytecode.analysis.parse.rewriters.AbstractExpressionRewriter
-
- org.benf.cfr.reader.bytecode.analysis.opgraph.op4rewriters.SwitchExpressionRewriter
-
- All Implemented Interfaces:
StructuredStatementTransformer
,ExpressionRewriter
public class SwitchExpressionRewriter extends AbstractExpressionRewriter implements StructuredStatementTransformer
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static class
SwitchExpressionRewriter.BlockSwitchDiscoverer
private class
SwitchExpressionRewriter.ClassifiedStm
private static class
SwitchExpressionRewriter.ClassifyType
private static class
SwitchExpressionRewriter.LValueSingleUsageCheckingRewriter
(package private) class
SwitchExpressionRewriter.RollState
private static class
SwitchExpressionRewriter.SwitchExpressionSearcher
(package private) static class
SwitchExpressionRewriter.SwitchExpressionTransformer
(package private) static class
SwitchExpressionRewriter.UsageCheck
-
Field Summary
Fields Modifier and Type Field Description private java.util.Set<StructuredStatement>
classifiedEmpty
private DecompilerComments
comments
private boolean
experimental
private Method
method
private static Predicate<Op04StructuredStatement>
notEmpty
-
Constructor Summary
Constructors Constructor Description SwitchExpressionRewriter(DecompilerComments comments, Method method)
-
Method Summary
-
Methods inherited from class org.benf.cfr.reader.bytecode.analysis.parse.rewriters.AbstractExpressionRewriter
handleStatement, rewriteExpression, rewriteExpression, rewriteExpression, rewriteExpression
-
-
-
-
Field Detail
-
experimental
private final boolean experimental
-
method
private final Method method
-
comments
private DecompilerComments comments
-
classifiedEmpty
private final java.util.Set<StructuredStatement> classifiedEmpty
-
notEmpty
private static final Predicate<Op04StructuredStatement> notEmpty
-
-
Constructor Detail
-
SwitchExpressionRewriter
public SwitchExpressionRewriter(DecompilerComments comments, Method method)
-
-
Method Detail
-
transform
public void transform(Op04StructuredStatement root)
-
doTransform
private void doTransform(Op04StructuredStatement root)
-
rewriteBlockSwitches
private void rewriteBlockSwitches(Op04StructuredStatement root)
-
transform
public StructuredStatement transform(StructuredStatement in, StructuredScope scope)
- Specified by:
transform
in interfaceStructuredStatementTransformer
-
rewrite
public void rewrite(Op04StructuredStatement root, StructuredScope scope)
-
replaceSwitch
private boolean replaceSwitch(Op04StructuredStatement container, java.util.List<StructuredStatement> structuredStatements, StructuredScope scope)
-
extractSwitchLValue
private LValue extractSwitchLValue(BlockIdentifier blockIdentifier, Op04StructuredStatement item, boolean last)
-
extractSwitchEntryPair
private Pair<StructuredCase,Expression> extractSwitchEntryPair(LValue target, BlockIdentifier blockIdentifier, Op04StructuredStatement item, java.util.List<Pair<Op04StructuredStatement,StructuredStatement>> replacements, boolean last)
-
extractSwitchEntry
private Expression extractSwitchEntry(LValue target, BlockIdentifier blockIdentifier, Op04StructuredStatement body, java.util.List<Pair<Op04StructuredStatement,StructuredStatement>> replacements, boolean last)
-
getRollState
private SwitchExpressionRewriter.RollState getRollState(Op04StructuredStatement body)
-
prequelAssign
private boolean prequelAssign(Op04StructuredStatement item, java.util.Set<Expression> directs)
-
rollOne
private boolean rollOne(Op04StructuredStatement root, UnaryFunction<SwitchExpressionRewriter.RollState,java.lang.Boolean> apply)
-
doAggressiveTransforms
private void doAggressiveTransforms(Op04StructuredStatement root)
-
rollSingleDefault
private boolean rollSingleDefault(SwitchExpressionRewriter.RollState rollState)
-
rollUpEmptySwitchAggregation
private boolean rollUpEmptySwitchAggregation(SwitchExpressionRewriter.RollState rollState)
-
combineSwitchExpressionWithOther
private void combineSwitchExpressionWithOther(SwitchExpressionRewriter.ClassifiedStm switchExpression, SwitchExpressionRewriter.ClassifiedStm other)
-
rollUpEmptySwitchCreation
private boolean rollUpEmptySwitchCreation(SwitchExpressionRewriter.RollState rollState)
-
combineEmptySwitchWithCreation
private void combineEmptySwitchWithCreation(SwitchExpressionRewriter.ClassifiedStm switchStm, SwitchExpressionRewriter.ClassifiedStm assignStm)
-
rollUpEmptySwitches
private boolean rollUpEmptySwitches(SwitchExpressionRewriter.RollState rollState)
-
addToSwitch
private void addToSwitch(Op04StructuredStatement swtch, Op04StructuredStatement add)
-
classify
private SwitchExpressionRewriter.ClassifiedStm classify(Op04StructuredStatement item)
-
isConstructorChain
private boolean isConstructorChain(Op04StructuredStatement item)
-
-