Class SymTypeExpression

    • Field Detail

      • functionList

        @Deprecated(forRemoval=true)
        protected java.util.List<FunctionSymbol> functionList
        Deprecated, for removal: This API element is subject to removal in a future version.
      • typeSymbol

        @Deprecated(forRemoval=true)
        protected TypeSymbol typeSymbol
        Deprecated, for removal: This API element is subject to removal in a future version.
        TypeSymbols are to be found in the corresponding subclasses, however, not every subclass will have a type symbol
    • Constructor Detail

      • SymTypeExpression

        public SymTypeExpression()
    • Method Detail

      • print

        public java.lang.String print()
        print: Conversion to a compact string, such as "int", "Person", "List< A >"
      • printFullName

        public java.lang.String printFullName()
        printFullName: prints the full name of the symbol, such as "java.util.List<java.lang.String>"
        Returns:
      • printAsJson

        protected java.lang.String printAsJson()
        printAsJson: Umwandlung in einen kompakten Json String
      • isValidType

        @Deprecated(forRemoval=true)
        public boolean isValidType()
        Deprecated, for removal: This API element is subject to removal in a future version.
        not well-thought-out and unused
        Am I a not valid type? e.g. unknown type, not all type variables set, pseudo types like typeVariables
      • isPrimitive

        public boolean isPrimitive()
        Am I primitive? (such as "int") (default: no)
      • isGenericType

        public boolean isGenericType()
        Am I a generic type? (such as "List<Integer>")
      • isTypeVariable

        public boolean isTypeVariable()
        Am I a bound type variable?
      • isInferenceVariable

        public boolean isInferenceVariable()
        Am I a free type variable?
      • isArrayType

        public boolean isArrayType()
        Am I an array?
      • isVoidType

        public boolean isVoidType()
        Am I of void type?
      • isNullType

        public boolean isNullType()
        Am I of null type?
      • isObjectType

        public boolean isObjectType()
        Am I an object type? (e.g. "String", "Person")
      • isRegExType

        public boolean isRegExType()
        Am I a regex type (e.g. 'R"rege(x(es)?|xps?)"')
      • isFunctionType

        public boolean isFunctionType()
        Am I a function type (e.g. "String -> Integer")
      • isSIUnitType

        public boolean isSIUnitType()
        Am I an SIUnit type (e.g., "[km/h]")
      • isNumericWithSIUnitType

        public boolean isNumericWithSIUnitType()
        Am I a numeric with SIUnit type (e.g., "[km/h]<float>")
      • isTupleType

        public boolean isTupleType()
        Am I a tuple type (e.g. "(String, int)")
      • isUnionType

        public boolean isUnionType()
        Am I an union type (e.g. "(A|B)")?
      • isIntersectionType

        public boolean isIntersectionType()
        Am I an intersection type (e.g. "(A&B)")
      • isObscureType

        public boolean isObscureType()
        Can I not have a type derived from (e.g. "1 - student")?
      • isWildcard

        public boolean isWildcard()
        Am I a wildcard (s. generics)?
      • getMethodList

        @Deprecated(forRemoval=true)
        public java.util.List<FunctionSymbol> getMethodList​(java.lang.String methodName,
                                                            boolean abstractTc)
        Deprecated, for removal: This API element is subject to removal in a future version.
      • getMethodList

        @Deprecated(forRemoval=true)
        public java.util.List<FunctionSymbol> getMethodList​(java.lang.String methodname,
                                                            boolean abstractTc,
                                                            de.monticore.symboltable.modifiers.AccessModifier modifier)
        Deprecated, for removal: This API element is subject to removal in a future version.
        returns the list of methods the SymTypeExpression can access and filters these for a method with specific name the last calculated type in the type check was no type
      • getCorrectMethods

        @Deprecated(forRemoval=true)
        public java.util.List<FunctionSymbol> getCorrectMethods​(java.lang.String methodName,
                                                                boolean outerIsType,
                                                                boolean abstractTc)
        Deprecated, for removal: This API element is subject to removal in a future version.
      • getCorrectMethods

        @Deprecated(forRemoval=true)
        protected java.util.List<FunctionSymbol> getCorrectMethods​(java.lang.String methodName,
                                                                   boolean outerIsType,
                                                                   boolean abstractTc,
                                                                   de.monticore.symboltable.modifiers.AccessModifier modifier)
        Deprecated, for removal: This API element is subject to removal in a future version.
        return the correct methods for the two situations: 1) the last calculated type in the type check was a type, then filter for non-static methods and add the static methods of this type 2) the last calculated type in the type check was an instance, then just resolve for methods
        Parameters:
        methodName - name of the method we search for
        outerIsType - true if last result of type check was type, false if it was an instance
        abstractTc - true if the tc is not used for object-oriented languages
        Returns:
        the correct methods for the specific case
      • transformMethodList

        @Deprecated(forRemoval=true)
        protected java.util.List<FunctionSymbol> transformMethodList​(java.lang.String methodName,
                                                                     java.util.List<FunctionSymbol> functions)
        Deprecated, for removal: This API element is subject to removal in a future version.
        transforms the methods by replacing their type variables with the actual type arguments
        Parameters:
        methodName - name of the method we search for
        functions - methods that need to be transformed
        Returns:
        transformed methods
      • replaceTypeVariables

        @Deprecated(forRemoval=true)
        public void replaceTypeVariables​(java.util.Map<TypeVarSymbol,​SymTypeExpression> replaceMap)
        Deprecated, for removal: This API element is subject to removal in a future version.
      • getMethodList

        @Deprecated(forRemoval=true)
        public java.util.List<FunctionSymbol> getMethodList​(java.lang.String methodName,
                                                            boolean outerIsType,
                                                            boolean abstractTc)
        Deprecated, for removal: This API element is subject to removal in a future version.
      • getMethodList

        @Deprecated(forRemoval=true)
        public java.util.List<FunctionSymbol> getMethodList​(java.lang.String methodName,
                                                            boolean outerIsType,
                                                            boolean abstractTc,
                                                            de.monticore.symboltable.modifiers.AccessModifier modifier)
        Deprecated, for removal: This API element is subject to removal in a future version.
        returns the correct methods in both cases: 1) the last result was a type, 2) the last result was an instance
        Parameters:
        methodName - name of the method we search for
        outerIsType - true if the last result was a type, false if it was an instance
        Returns:
        the correct methods for the specific case
      • getFieldList

        @Deprecated(forRemoval=true)
        public java.util.List<VariableSymbol> getFieldList​(java.lang.String fieldName,
                                                           boolean abstractTc)
        Deprecated, for removal: This API element is subject to removal in a future version.
      • getFieldList

        @Deprecated(forRemoval=true)
        public java.util.List<VariableSymbol> getFieldList​(java.lang.String fieldName,
                                                           boolean abstractTc,
                                                           de.monticore.symboltable.modifiers.AccessModifier modifier)
        Deprecated, for removal: This API element is subject to removal in a future version.
        returns the list of fields the SymTypeExpression can access and filters these for a field with specific name
      • getFieldList

        @Deprecated(forRemoval=true)
        public java.util.List<VariableSymbol> getFieldList​(java.lang.String fieldName,
                                                           boolean outerIsType,
                                                           boolean abstractTc)
        Deprecated, for removal: This API element is subject to removal in a future version.
      • getFieldList

        @Deprecated(forRemoval=true)
        public java.util.List<VariableSymbol> getFieldList​(java.lang.String fieldName,
                                                           boolean outerIsType,
                                                           boolean abstractTc,
                                                           de.monticore.symboltable.modifiers.AccessModifier modifier)
        Deprecated, for removal: This API element is subject to removal in a future version.
        returns the correct fields in both cases: 1) the last result was a type, 2) the last result was an instance
        Parameters:
        fieldName - name of the field we search for
        outerIsType - true if the last result was a type, false if it was an instance
        Returns:
        the correct fields for the specific case
      • getCorrectFields

        @Deprecated(forRemoval=true)
        public java.util.List<VariableSymbol> getCorrectFields​(java.lang.String fieldName,
                                                               boolean outerIsType,
                                                               boolean abstractTc)
        Deprecated, for removal: This API element is subject to removal in a future version.
      • getCorrectFields

        @Deprecated(forRemoval=true)
        protected java.util.List<VariableSymbol> getCorrectFields​(java.lang.String fieldName,
                                                                  boolean outerIsType,
                                                                  boolean abstractTc,
                                                                  de.monticore.symboltable.modifiers.AccessModifier modifier)
        Deprecated, for removal: This API element is subject to removal in a future version.
        return the correct fields for the two situations: 1) the last calculated type in the type check was a type, then filter for non-static fields and add the static fields of this type 2) the last calculated type in the type check was an instance, then just resolve for fields
        Parameters:
        fieldName - name of the field we search for
        outerIsType - true if last result of type check was type, false if it was an instance
        Returns:
        the correct fields for the specific case
      • transformFieldList

        @Deprecated(forRemoval=true)
        protected java.util.List<VariableSymbol> transformFieldList​(java.lang.String fieldName,
                                                                    java.util.List<VariableSymbol> fields)
        Deprecated, for removal: This API element is subject to removal in a future version.
        transforms the fields by replacing their type variables with the actual type arguments
        Parameters:
        fieldName - name of the field we search for
        fields - fields that need to be transformed
        Returns:
        transformed fields
      • hasTypeInfo

        public boolean hasTypeInfo()
        Whether we can call getTypeInfo
      • getTypeInfo

        public TypeSymbol getTypeInfo()
        Returns an TypeSymbol representing the type Only to be called according to hasTypeInfo()

        As most SymTypeExpressions do not have a TypeSymbol (this is legacy), this method will log a warning and is expected to be overridden, if a TypeSymbol exists.

      • _internal_setSourceInfo

        public void _internal_setSourceInfo​(SymTypeSourceInfo sourceInfo)
        used during deep-cloning, clones the SymTypeSourceInfo