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
SpecialStaticFeatureAccessProcessorfor found allVariablethat change value and
Variablefor read values from it Instances ofStatementProcessorForExtractRefactoringare stateful and are not safe for use by multiple threads.
-
-
Field Summary
Fields Modifier and Type Field Description protected DynamicFeatureAccessComputertypeComputerprotected Map<Variable,List<org.eclipse.xtext.nodemodel.INode>>variablesChangeValueprotected 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 voidaddNewVariable(Variable variable, org.eclipse.xtext.nodemodel.INode node, Map<Variable,List<org.eclipse.xtext.nodemodel.INode>> variables)Add variable tovariablesprotected voiddoProcess(StaticFeatureAccess sfa, boolean targetOfAssignment)Function to perform processing of eachStaticFeatureAccesscontaining in theBlock.protected booleanisRefMethodParam(StaticFeatureAccess sfa)Checks thatsfais 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 benulltypeComputer-DynamicFeatureAccessComputerfor 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:StaticFeatureAccessProcessorFunction to perform processing of eachStaticFeatureAccesscontaining in theBlock.- Specified by:
doProcessin classStaticFeatureAccessProcessor- Parameters:
sfa-StaticFeatureAccessinstance to process. Notnull.targetOfAssignment-trueif passedStaticFeatureAccessrepresents 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 thatsfais part of method call- Parameters:
sfa- checkingStaticFeatureAccess, can't benull- Returns:
trueifsfais part of method call,falseotherwise
-
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 benullnode- actualINodeof variable, can't benullvariables- container for adding, can't benull
-
-