Package com._1c.g5.v8.dt.bsl.common
Class VariableProcessor
- java.lang.Object
-
- com._1c.g5.v8.dt.bsl.common.StaticFeatureAccessProcessor
-
- com._1c.g5.v8.dt.bsl.common.VariableProcessor
-
- Direct Known Subclasses:
com._1c.g5.v8.dt.internal.bsl.ui.refactoring.StaticFeatureAccessProcessorForExtractRefactoring
public class VariableProcessor extends StaticFeatureAccessProcessor
SpecialStaticFeatureAccessProcessor
for found allVariable
that change value and
Variable
for read values from it Instances ofStatementProcessorForExtractRefactoring
are stateful and are not safe for use by multiple threads.
-
-
Field Summary
Fields Modifier and Type Field Description protected DynamicFeatureAccessComputer
typeComputer
protected Map<Variable,List<org.eclipse.xtext.nodemodel.INode>>
variablesChangeValue
protected Map<Variable,List<org.eclipse.xtext.nodemodel.INode>>
variablesForReadValue
-
Constructor Summary
Constructors Constructor Description VariableProcessor(Collection<Statement> allStatements, DynamicFeatureAccessComputer typeComputer)
Initialize with collection of Statements
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
addNewVariable(Variable variable, org.eclipse.xtext.nodemodel.INode node, Map<Variable,List<org.eclipse.xtext.nodemodel.INode>> variables)
Add variable tovariables
protected void
doProcess(StaticFeatureAccess sfa, boolean targetOfAssignment)
Function to perform processing of eachStaticFeatureAccess
containing in theBlock
.protected boolean
isRefMethodParam(StaticFeatureAccess sfa)
Checks thatsfa
is part of method callMap<Variable,List<org.eclipse.xtext.nodemodel.INode>>
variablesForChangeValue()
Gets all variables and their nodes which change valueMap<Variable,List<org.eclipse.xtext.nodemodel.INode>>
variablesForReadValue()
Gets all variables and their nodes from which values are read-
Methods inherited from class com._1c.g5.v8.dt.bsl.common.StaticFeatureAccessProcessor
doProcessInternal, doProcessInternal, doProcessInternal, doProcessInternal, doProcessInternal, doProcessInternal, doProcessInternal, doProcessInternal, doProcessInternal, isCanceled, process
-
-
-
-
Constructor Detail
-
VariableProcessor
public VariableProcessor(Collection<Statement> allStatements, DynamicFeatureAccessComputer typeComputer)
Initialize with collection of Statements- Parameters:
allStatements
- collection of theStatement
, can't benull
typeComputer
-DynamicFeatureAccessComputer
for resolve object inDynamicFeatureAccess
, can't benull
-
-
Method Detail
-
variablesForChangeValue
public Map<Variable,List<org.eclipse.xtext.nodemodel.INode>> variablesForChangeValue()
Gets all variables and their nodes which change value- Returns:
- accordance between variables which change value and their
INode
-
variablesForReadValue
public Map<Variable,List<org.eclipse.xtext.nodemodel.INode>> variablesForReadValue()
Gets all variables and their nodes from which values are read- Returns:
- accordance between variables from which values are read and their
INode
-
doProcess
protected void doProcess(StaticFeatureAccess sfa, boolean targetOfAssignment)
Description copied from class:StaticFeatureAccessProcessor
Function to perform processing of eachStaticFeatureAccess
containing in theBlock
.- Specified by:
doProcess
in classStaticFeatureAccessProcessor
- Parameters:
sfa
-StaticFeatureAccess
instance to process. Notnull
.targetOfAssignment
-true
if passedStaticFeatureAccess
represents target of assignment (single variable in the left side of assignment or loop variable in the For statement)
-
isRefMethodParam
protected boolean isRefMethodParam(StaticFeatureAccess sfa)
Checks thatsfa
is part of method call- Parameters:
sfa
- checkingStaticFeatureAccess
, can't benull
- Returns:
true
ifsfa
is part of method call,false
otherwise
-
addNewVariable
protected void addNewVariable(Variable variable, org.eclipse.xtext.nodemodel.INode node, Map<Variable,List<org.eclipse.xtext.nodemodel.INode>> variables)
Add variable tovariables
- Parameters:
variable
- add variable, can't benull
node
- actualINode
of variable, can't benull
variables
- container for adding, can't benull
-
-