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 classprivate classprivate static enumprivate static class(package private) classprivate static class(package private) static class(package private) static class -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final Set<StructuredStatement> private DecompilerCommentsprivate final booleanprivate final Methodprivate static final Predicate<Op04StructuredStatement> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate voidprivate voidcombineEmptySwitchWithCreation(SwitchExpressionRewriter.ClassifiedStm switchStm, SwitchExpressionRewriter.ClassifiedStm assignStm) private voidcombineSwitchExpressionWithOther(SwitchExpressionRewriter.ClassifiedStm switchExpression, SwitchExpressionRewriter.ClassifiedStm other) private voidprivate voidprivate ExpressionextractSwitchEntry(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 LValueextractSwitchLValue(BlockIdentifier blockIdentifier, Op04StructuredStatement item, boolean last) private booleanprivate booleanprequelAssign(Op04StructuredStatement item, Set<Expression> directs) private booleanreplaceSwitch(Op04StructuredStatement container, List<StructuredStatement> structuredStatements, StructuredScope scope) voidrewrite(Op04StructuredStatement root, StructuredScope scope) private voidprivate booleanrollOne(Op04StructuredStatement root, UnaryFunction<SwitchExpressionRewriter.RollState, Boolean> apply) private booleanprivate booleanprivate booleanprivate booleanvoidtransform(StructuredStatement in, StructuredScope scope) Methods inherited from class 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:
transformin 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
-