Class QlTypesComparator

    • Constructor Detail

      • QlTypesComparator

        public QlTypesComparator()
    • Method Detail

      • compare

        public boolean compare​(TypeDescription expectedType,
                               List<TypeDescription> allExpectedCastingType,
                               TypeDescription getType)
        Comparator types for Ql language
        Specified by:
        compare in interface ITypesComparator
        Parameters:
        expectedType - expected type of expression in the point of calling this function
        allExpectedCastingType - all types for exprectedType which it can be replaced
        getType - got type of expression in the point of calling this function
        Returns:
        true, if getType equals or can be casting to exprectedType
      • compare

        public boolean compare​(TypeDescription expectedType,
                               List<TypeDescription> allExpectedCastingType,
                               TypeDescriptionSource getType)
        Description copied from interface: ITypesComparator
        This function compare expected and got type of expression
        Specified by:
        compare in interface ITypesComparator
        Parameters:
        expectedType - expected type of expression in the point of calling this function
        allExpectedCastingType - all types for exprectedType which it can be replaced
        getType - got type of expression in the point of calling this function
        Returns:
        true, if getType equals or can be casting to exprectedType
      • isArbitraryType

        public boolean isArbitraryType​(TypeDescription type)
        Check for Arbitrary type in Ql language
        Specified by:
        isArbitraryType in interface ITypesComparator
        Parameters:
        type - checking type
        Returns:
        true, if type is arbitrary i.e it equals for all type
      • equalType

        public boolean equalType​(TypeDescription typeF,
                                 TypeDescription typeS)
        Check for equal type in ql language
        Specified by:
        equalType in interface ITypesComparator
        Parameters:
        typeF - - comparing type
        typeS - - comparing type
        Returns:
        true, if typeF equal typeS
      • isCrossCompoundType

        public boolean isCrossCompoundType​(TypeDescription compoundTypeF,
                                           TypeDescription compoundTypeS)
        Is there intersection between compound type
        Parameters:
        compoundTypeF - checking compound type, can't be null
        compoundTypeS - checking compound type, can't be null
        Returns:
        true, if intersection was detected, false otherwise
      • isValueStorageType

        public boolean isValueStorageType​(TypeDescription type)
        Check for type 'ValueStorage'
        Parameters:
        type - checking type
        Returns:
        true, if type equal with valueStorage
      • isRefType

        public boolean isRefType​(AbstractExpression expr,
                                 TypeDescriptionSource type)
        Check for reference type expr and type
        Parameters:
        expr - checking expression
        type - checking type
        Returns:
        true, if expr or type is reference type
      • equalTypeItem

        public boolean equalTypeItem​(TypeItem typeItemF,
                                     TypeItem typeItemS)
        Compare two type items with EcoreUtil for equals
        Parameters:
        typeItemF - checking type
        typeItemS - checking type
        Returns:
        true, if type items equal