Class AbstractLValueScopeDiscoverer
- java.lang.Object
-
- org.benf.cfr.reader.bytecode.analysis.parse.utils.scope.AbstractLValueScopeDiscoverer
-
- All Implemented Interfaces:
LValueAssignmentCollector<StructuredStatement>
,LValueUsageCollector
,LValueScopeDiscoverer
- Direct Known Subclasses:
LocalClassScopeDiscoverImpl
,LValueScopeDiscoverImpl
public abstract class AbstractLValueScopeDiscoverer extends java.lang.Object implements LValueScopeDiscoverer
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) class
AbstractLValueScopeDiscoverer.ScopeDefinition
private static class
AbstractLValueScopeDiscoverer.ScopeKey
-
Field Summary
Fields Modifier and Type Field Description (package private) java.util.Stack<StatementContainer<StructuredStatement>>
currentBlock
(package private) int
currentDepth
(package private) StatementContainer<StructuredStatement>
currentMark
(package private) java.util.List<AbstractLValueScopeDiscoverer.ScopeDefinition>
discoveredCreations
(package private) java.util.Map<NamedVariable,AbstractLValueScopeDiscoverer.ScopeDefinition>
earliestDefinition
(package private) java.util.Map<java.lang.Integer,java.util.Map<NamedVariable,java.lang.Boolean>>
earliestDefinitionsByLevel
private ScopeDiscoverInfoCache
factCache
(package private) Options
options
private MethodPrototype
prototype
(package private) VariableFactory
variableFactory
-
Constructor Summary
Constructors Constructor Description AbstractLValueScopeDiscoverer(Options options, MethodPrototype prototype, VariableFactory variableFactory)
-
Method Summary
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.benf.cfr.reader.bytecode.analysis.parse.utils.scope.LValueScopeDiscoverer
collect, collectLocalVariableAssignment, descendLambdas
-
-
-
-
Field Detail
-
earliestDefinition
final java.util.Map<NamedVariable,AbstractLValueScopeDiscoverer.ScopeDefinition> earliestDefinition
-
earliestDefinitionsByLevel
final java.util.Map<java.lang.Integer,java.util.Map<NamedVariable,java.lang.Boolean>> earliestDefinitionsByLevel
-
currentDepth
int currentDepth
-
currentBlock
java.util.Stack<StatementContainer<StructuredStatement>> currentBlock
-
discoveredCreations
final java.util.List<AbstractLValueScopeDiscoverer.ScopeDefinition> discoveredCreations
-
variableFactory
final VariableFactory variableFactory
-
currentMark
StatementContainer<StructuredStatement> currentMark
-
options
Options options
-
prototype
private final MethodPrototype prototype
-
factCache
private final ScopeDiscoverInfoCache factCache
-
-
Constructor Detail
-
AbstractLValueScopeDiscoverer
AbstractLValueScopeDiscoverer(Options options, MethodPrototype prototype, VariableFactory variableFactory)
-
-
Method Detail
-
getFactCache
ScopeDiscoverInfoCache getFactCache()
-
enterBlock
public void enterBlock(StructuredStatement structuredStatement)
- Specified by:
enterBlock
in interfaceLValueScopeDiscoverer
-
ifCanDefine
public boolean ifCanDefine()
- Specified by:
ifCanDefine
in interfaceLValueScopeDiscoverer
-
processOp04Statement
public void processOp04Statement(Op04StructuredStatement statement)
- Specified by:
processOp04Statement
in interfaceLValueScopeDiscoverer
-
mark
public void mark(StatementContainer<StructuredStatement> mark)
- Specified by:
mark
in interfaceLValueScopeDiscoverer
-
leaveBlock
public void leaveBlock(StructuredStatement structuredStatement)
- Specified by:
leaveBlock
in interfaceLValueScopeDiscoverer
-
collect
public void collect(StackSSALabel lValue, StatementContainer<StructuredStatement> statementContainer, Expression value)
- Specified by:
collect
in interfaceLValueAssignmentCollector<StructuredStatement>
- Specified by:
collect
in interfaceLValueScopeDiscoverer
-
collectMultiUse
public void collectMultiUse(StackSSALabel lValue, StatementContainer<StructuredStatement> statementContainer, Expression value)
- Specified by:
collectMultiUse
in interfaceLValueAssignmentCollector<StructuredStatement>
- Specified by:
collectMultiUse
in interfaceLValueScopeDiscoverer
-
collectMutatedLValue
public void collectMutatedLValue(LValue lValue, StatementContainer<StructuredStatement> statementContainer, Expression value)
- Specified by:
collectMutatedLValue
in interfaceLValueAssignmentCollector<StructuredStatement>
- Specified by:
collectMutatedLValue
in interfaceLValueScopeDiscoverer
-
markDiscoveredCreations
public void markDiscoveredCreations()
-
getNonInit
private StatementContainer<StructuredStatement> getNonInit(StatementContainer<StructuredStatement> creationContainer)
-
defineInsideSwitchContent
private boolean defineInsideSwitchContent(LValue scopedEntity, java.util.List<AbstractLValueScopeDiscoverer.ScopeDefinition> definitions, java.util.List<StatementContainer<StructuredStatement>> commonScope)
-
getCommonPrefix
private static <T> java.util.List<T> getCommonPrefix(java.util.List<T> a, java.util.List<T> b)
-
getUnclashedType
private JavaTypeInstance getUnclashedType(InferredJavaType inferredJavaType)
-
-