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 classprivate static final classprivate static final classprotected static final class -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final DecompilerContextprotected final List<DeclareVariablesTransform.VariableToDeclare> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static booleancanMoveVariableIntoSubBlock(DefiniteAssignmentAnalysis analysis, BlockStatement block, Statement statement, String variableName, boolean allowPassIntoLoops) private static booleancanRedeclareVariable(DefiniteAssignmentAnalysis analysis, BlockStatement block, AstNode node, String variableName) private voiddeclareVariableInBlock(DefiniteAssignmentAnalysis analysis, BlockStatement block, AstType type, String variableName, Variable variable, boolean allowPassIntoLoops) static booleanfindDeclarationPoint(DefiniteAssignmentAnalysis analysis, VariableDeclarationStatement declaration, BlockStatement block, StrongBox<Statement> declarationPoint, Statement skipUpThrough) (package private) static booleanfindDeclarationPoint(DefiniteAssignmentAnalysis analysis, String variableName, boolean allowPassIntoLoops, BlockStatement block, StrongBox<Statement> declarationPoint, Statement skipUpThrough) private static booleanhasNestedBlocks(AstNode node) voidprivate voidrun(AstNode node, DefiniteAssignmentAnalysis daa) private booleantryConvertAssignmentExpressionIntoVariableDeclaration(BlockStatement block, Expression expression, AstType type, String variableName) private booleantryConvertAssignmentExpressionIntoVariableDeclaration(BlockStatement block, Statement declarationPoint, AstType type, String variableName) private static booleanusesVariable(AstNode node, String variableName)
-
Field Details
-
variablesToDeclare
-
context
-
-
Constructor Details
-
DeclareVariablesTransform
-
-
Method Details
-
run
- Specified by:
runin 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)
-