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 ClassesModifier and TypeClassDescriptionprivate static class
private class
private static enum
private static class
(package private) class
private static class
(package private) static class
(package private) static class
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final Set<StructuredStatement>
private DecompilerComments
private final boolean
private final Method
private static final Predicate<Op04StructuredStatement>
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate void
private void
combineEmptySwitchWithCreation
(SwitchExpressionRewriter.ClassifiedStm switchStm, SwitchExpressionRewriter.ClassifiedStm assignStm) private void
combineSwitchExpressionWithOther
(SwitchExpressionRewriter.ClassifiedStm switchExpression, SwitchExpressionRewriter.ClassifiedStm other) private void
private void
private Expression
extractSwitchEntry
(LValue target, BlockIdentifier blockIdentifier, Op04StructuredStatement body, List<Pair<Op04StructuredStatement, StructuredStatement>> replacements, boolean last) private Pair<StructuredCase,
Expression> extractSwitchEntryPair
(LValue target, BlockIdentifier blockIdentifier, Op04StructuredStatement item, List<Pair<Op04StructuredStatement, StructuredStatement>> replacements, boolean last) private LValue
extractSwitchLValue
(BlockIdentifier blockIdentifier, Op04StructuredStatement item, boolean last) private boolean
private boolean
prequelAssign
(Op04StructuredStatement item, Set<Expression> directs) private boolean
replaceSwitch
(Op04StructuredStatement container, List<StructuredStatement> structuredStatements, StructuredScope scope) void
rewrite
(Op04StructuredStatement root, StructuredScope scope) private void
private boolean
rollOne
(Op04StructuredStatement root, UnaryFunction<SwitchExpressionRewriter.RollState, Boolean> apply) private boolean
private boolean
private boolean
private boolean
void
transform
(StructuredStatement in, StructuredScope scope) Methods inherited from class org.benf.cfr.reader.bytecode.analysis.parse.rewriters.AbstractExpressionRewriter
handleStatement, rewriteExpression, rewriteExpression, rewriteExpression, rewriteExpression
-
Field Details
-
experimental
private final boolean experimental -
method
-
comments
-
classifiedEmpty
-
notEmpty
-
-
Constructor Details
-
SwitchExpressionRewriter
-
-
Method Details
-
transform
-
doTransform
-
rewriteBlockSwitches
-
transform
- Specified by:
transform
in interfaceStructuredStatementTransformer
-
rewrite
-
replaceSwitch
private boolean replaceSwitch(Op04StructuredStatement container, 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, List<Pair<Op04StructuredStatement, StructuredStatement>> replacements, boolean last) -
extractSwitchEntry
private Expression extractSwitchEntry(LValue target, BlockIdentifier blockIdentifier, Op04StructuredStatement body, List<Pair<Op04StructuredStatement, StructuredStatement>> replacements, boolean last) -
getRollState
-
prequelAssign
-
rollOne
private boolean rollOne(Op04StructuredStatement root, UnaryFunction<SwitchExpressionRewriter.RollState, Boolean> apply) -
doAggressiveTransforms
-
rollSingleDefault
-
rollUpEmptySwitchAggregation
-
combineSwitchExpressionWithOther
private void combineSwitchExpressionWithOther(SwitchExpressionRewriter.ClassifiedStm switchExpression, SwitchExpressionRewriter.ClassifiedStm other) -
rollUpEmptySwitchCreation
-
combineEmptySwitchWithCreation
private void combineEmptySwitchWithCreation(SwitchExpressionRewriter.ClassifiedStm switchStm, SwitchExpressionRewriter.ClassifiedStm assignStm) -
rollUpEmptySwitches
-
addToSwitch
-
classify
-
isConstructorChain
-