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:
StaticFeatureAccessProcessorForExtractRefactoring
Special
StaticFeatureAccessProcessor
for found all Variable
that change value and Variable
for read values from it
Instances of StatementProcessorForExtractRefactoring
are stateful and are
not safe for use by multiple threads.-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionVariableProcessor
(Collection<Statement> allStatements, DynamicFeatureAccessComputer typeComputer) Initialize with collection of Statements -
Method Summary
Modifier and TypeMethodDescriptionprotected 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
Checks thatsfa
is part of method callGets all variables and their nodes which change valueGets all variables and their nodes from which values are readMethods inherited from class com._1c.g5.v8.dt.bsl.common.StaticFeatureAccessProcessor
doProcessInternal, doProcessInternal, doProcessInternal, doProcessInternal, doProcessInternal, doProcessInternal, doProcessInternal, doProcessInternal, doProcessInternal, isCanceled, process
-
Field Details
-
typeComputer
-
variablesChangeValue
-
variablesForReadValue
-
-
Constructor Details
-
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 Details
-
variablesForChangeValue
Gets all variables and their nodes which change value- Returns:
- accordance between variables which change value and their
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
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
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
-