Package com._1c.g5.v8.dt.bsl.common
Interface IStaticExpressionValueComputer
-
public interface IStaticExpressionValueComputer
The computer allows to get various types of string, boolean, number static content from code. This computer supports only simple binary operations and variable assignments, so it returns only single and statically computed content, dynamic or variable content cannot be computed.
In case of cycles or some variable computing logic of the content this computer should break and returnnull
or empty.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description List<IStringLiteralTextProvider>
getArrayOfStrings(org.eclipse.emf.ecore.EObject expression)
Gets the list of string content for the expression that isArray
in 1C code with adding strings to the array.BooleanLiteral
getBooleanContent(org.eclipse.emf.ecore.EObject expression)
Gets the boolean literal from the code.org.eclipse.xtext.util.Pair<Double,Collection<NumberLiteral>>
getNumberContent(org.eclipse.emf.ecore.EObject expression)
Gets the number content from the code.IStringLiteralTextProvider
getStringContent(org.eclipse.emf.ecore.EObject expression)
Gets the static string content of the expression.Map<String,org.eclipse.xtext.util.Pair<IStringLiteralTextProvider,IStringLiteralTextProvider>>
getStructureOfStrings(org.eclipse.emf.ecore.EObject expression)
Gets the 1C structure (akaMap<String, String>
) with string content in keys and values for the given expression.default Map<String,String>
getStructureOfStringsContent(org.eclipse.emf.ecore.EObject expression)
Gets the 1C structure (akaMap<String, String>
) with string content in keys and values for the given expression.
-
-
-
Method Detail
-
getStringContent
IStringLiteralTextProvider getStringContent(org.eclipse.emf.ecore.EObject expression)
Gets the static string content of the expression.- Parameters:
expression
- the expression, may benull
.- Returns:
- the expression string content and its source string literals, can return
null
Returnsnull
if the expression isnull
or computing logic of content is not static (variable result), untyped code and etc.
-
getStructureOfStrings
Map<String,org.eclipse.xtext.util.Pair<IStringLiteralTextProvider,IStringLiteralTextProvider>> getStructureOfStrings(org.eclipse.emf.ecore.EObject expression)
Gets the 1C structure (akaMap<String, String>
) with string content in keys and values for the given expression. This method computes all insertion of to the structure in current method.- Parameters:
expression
- the expression, may benull
.- Returns:
- the structure expression string content, where map entry key is structure key and map entry value is
a pair of key string literal text provider and 1C structure value string literal text provider,
which may be
null
. Cannot returnnull
.
-
getStructureOfStringsContent
default Map<String,String> getStructureOfStringsContent(org.eclipse.emf.ecore.EObject expression)
Gets the 1C structure (akaMap<String, String>
) with string content in keys and values for the given expression. This method computes all insertion of to the structure in current method.- Parameters:
expression
- the expression, may benull
.- Returns:
- the 1C structure of strings content. Cannot return
null
.
-
getArrayOfStrings
List<IStringLiteralTextProvider> getArrayOfStrings(org.eclipse.emf.ecore.EObject expression)
Gets the list of string content for the expression that isArray
in 1C code with adding strings to the array.- Parameters:
expression
- the expression, may benull
.- Returns:
- the list of string content, cannot return
null
.
-
getBooleanContent
BooleanLiteral getBooleanContent(org.eclipse.emf.ecore.EObject expression)
Gets the boolean literal from the code.- Parameters:
expression
- the expression, may benull
.- Returns:
- the boolean literal or returns
null
if cannot be computed due different reasons, including dynamic or variable result, untyped code and etc.
-
getNumberContent
org.eclipse.xtext.util.Pair<Double,Collection<NumberLiteral>> getNumberContent(org.eclipse.emf.ecore.EObject expression)
Gets the number content from the code.- Parameters:
expression
- the expression, may benull
.- Returns:
- the resulting number of all arithmetical operations of each
NumberLiteral
from the code and all number literals computing this value, or returnsnull
if static value cannot be computed due different resons including dynamic or variable result, untyped code and etc.
-
-