Class SwitchStringRewriter
- java.lang.Object
-
- org.benf.cfr.reader.bytecode.analysis.opgraph.op4rewriters.SwitchStringRewriter
-
- All Implemented Interfaces:
Op04Rewriter
public class SwitchStringRewriter extends java.lang.Object implements Op04Rewriter
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static classSwitchStringRewriter.EmptySwitchStringMatchResultCollectorprivate static classSwitchStringRewriter.FailedRewriteExceptionprivate static classSwitchStringRewriter.SwitchStringMatchResultCollectorprivate static classSwitchStringRewriter.TooOptimisticMatchException
-
Field Summary
Fields Modifier and Type Field Description private BytecodeMetabytecodeMetaprivate ClassFileVersionclassFileVersionprivate Optionsoptions
-
Constructor Summary
Constructors Constructor Description SwitchStringRewriter(Options options, ClassFileVersion classFileVersion, BytecodeMeta bytecodeMeta)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private static java.lang.IntegergetInt(Expression e)private static java.lang.StringgetString(Expression e)private static booleanisLVOk(Expression lve, LValue lv, StructuredStatement assign)voidrewrite(Op04StructuredStatement root)private voidrewriteComplex(java.util.List<StructuredStatement> structuredStatements)private voidrewriteEmpty(java.util.List<StructuredStatement> structuredStatements)private StructuredSwitchrewriteSwitch(StructuredSwitch original, SwitchStringRewriter.SwitchStringMatchResultCollector matchResultCollector)
-
-
-
Field Detail
-
options
private final Options options
-
classFileVersion
private final ClassFileVersion classFileVersion
-
bytecodeMeta
private final BytecodeMeta bytecodeMeta
-
-
Constructor Detail
-
SwitchStringRewriter
public SwitchStringRewriter(Options options, ClassFileVersion classFileVersion, BytecodeMeta bytecodeMeta)
-
-
Method Detail
-
rewrite
public void rewrite(Op04StructuredStatement root)
- Specified by:
rewritein interfaceOp04Rewriter
-
rewriteEmpty
private void rewriteEmpty(java.util.List<StructuredStatement> structuredStatements)
-
rewriteComplex
private void rewriteComplex(java.util.List<StructuredStatement> structuredStatements)
-
rewriteSwitch
private StructuredSwitch rewriteSwitch(StructuredSwitch original, SwitchStringRewriter.SwitchStringMatchResultCollector matchResultCollector)
-
isLVOk
private static boolean isLVOk(Expression lve, LValue lv, StructuredStatement assign)
-
getString
private static java.lang.String getString(Expression e)
-
getInt
private static java.lang.Integer getInt(Expression e)
-
-