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 return null or empty.
    • Method Detail

      • getStringContent

        IStringLiteralTextProvider getStringContent​(org.eclipse.emf.ecore.EObject expression)
        Gets the static string content of the expression.
        Parameters:
        expression - the expression, may be null.
        Returns:
        the expression string content and its source string literals, can return null Returns null if the expression is null 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 (aka Map<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 be null.
        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 return null.
      • getStructureOfStringsContent

        default Map<String,​String> getStructureOfStringsContent​(org.eclipse.emf.ecore.EObject expression)
        Gets the 1C structure (aka Map<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 be null.
        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 is Array in 1C code with adding strings to the array.
        Parameters:
        expression - the expression, may be null.
        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 be null.
        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 be null.
        Returns:
        the resulting number of all arithmetical operations of each NumberLiteral from the code and all number literals computing this value, or returns null if static value cannot be computed due different resons including dynamic or variable result, untyped code and etc.