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 class
SwitchStringRewriter.EmptySwitchStringMatchResultCollector
private static class
SwitchStringRewriter.FailedRewriteException
private static class
SwitchStringRewriter.SwitchStringMatchResultCollector
private static class
SwitchStringRewriter.TooOptimisticMatchException
-
Field Summary
Fields Modifier and Type Field Description private BytecodeMeta
bytecodeMeta
private ClassFileVersion
classFileVersion
private Options
options
-
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.Integer
getInt(Expression e)
private static java.lang.String
getString(Expression e)
private static boolean
isLVOk(Expression lve, LValue lv, StructuredStatement assign)
void
rewrite(Op04StructuredStatement root)
private void
rewriteComplex(java.util.List<StructuredStatement> structuredStatements)
private void
rewriteEmpty(java.util.List<StructuredStatement> structuredStatements)
private StructuredSwitch
rewriteSwitch(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:
rewrite
in 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)
-
-