Class DeclareVariablesTransform
java.lang.Object
com.strobel.decompiler.languages.java.ast.transforms.DeclareVariablesTransform
- All Implemented Interfaces:
IAstTransform
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static final class
private static final class
private static final class
protected static final class
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final DecompilerContext
protected final List
<DeclareVariablesTransform.VariableToDeclare> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static boolean
canMoveVariableIntoSubBlock
(DefiniteAssignmentAnalysis analysis, BlockStatement block, Statement statement, String variableName, boolean allowPassIntoLoops) private static boolean
canRedeclareVariable
(DefiniteAssignmentAnalysis analysis, BlockStatement block, AstNode node, String variableName) private void
declareVariableInBlock
(DefiniteAssignmentAnalysis analysis, BlockStatement block, AstType type, String variableName, Variable variable, boolean allowPassIntoLoops) static boolean
findDeclarationPoint
(DefiniteAssignmentAnalysis analysis, VariableDeclarationStatement declaration, BlockStatement block, StrongBox<Statement> declarationPoint, Statement skipUpThrough) (package private) static boolean
findDeclarationPoint
(DefiniteAssignmentAnalysis analysis, String variableName, boolean allowPassIntoLoops, BlockStatement block, StrongBox<Statement> declarationPoint, Statement skipUpThrough) private static boolean
hasNestedBlocks
(AstNode node) void
private void
run
(AstNode node, DefiniteAssignmentAnalysis daa) private boolean
tryConvertAssignmentExpressionIntoVariableDeclaration
(BlockStatement block, Expression expression, AstType type, String variableName) private boolean
tryConvertAssignmentExpressionIntoVariableDeclaration
(BlockStatement block, Statement declarationPoint, AstType type, String variableName) private static boolean
usesVariable
(AstNode node, String variableName)
-
Field Details
-
variablesToDeclare
-
context
-
-
Constructor Details
-
DeclareVariablesTransform
-
-
Method Details
-
run
- Specified by:
run
in interfaceIAstTransform
-
analyze
private DeclareVariablesTransform.AnalysisResult analyze(DeclareVariablesTransform.VariableToDeclare v, AstNode scope) -
run
-
declareVariableInBlock
private void declareVariableInBlock(DefiniteAssignmentAnalysis analysis, BlockStatement block, AstType type, String variableName, Variable variable, boolean allowPassIntoLoops) -
findDeclarationPoint
public static boolean findDeclarationPoint(DefiniteAssignmentAnalysis analysis, VariableDeclarationStatement declaration, BlockStatement block, StrongBox<Statement> declarationPoint, Statement skipUpThrough) -
findDeclarationPoint
static boolean findDeclarationPoint(DefiniteAssignmentAnalysis analysis, String variableName, boolean allowPassIntoLoops, BlockStatement block, StrongBox<Statement> declarationPoint, Statement skipUpThrough) -
canMoveVariableIntoSubBlock
private static boolean canMoveVariableIntoSubBlock(DefiniteAssignmentAnalysis analysis, BlockStatement block, Statement statement, String variableName, boolean allowPassIntoLoops) -
usesVariable
-
canRedeclareVariable
private static boolean canRedeclareVariable(DefiniteAssignmentAnalysis analysis, BlockStatement block, AstNode node, String variableName) -
hasNestedBlocks
-
tryConvertAssignmentExpressionIntoVariableDeclaration
private boolean tryConvertAssignmentExpressionIntoVariableDeclaration(BlockStatement block, Statement declarationPoint, AstType type, String variableName) -
tryConvertAssignmentExpressionIntoVariableDeclaration
private boolean tryConvertAssignmentExpressionIntoVariableDeclaration(BlockStatement block, Expression expression, AstType type, String variableName)
-