Class Type

    • Field Detail

      • UNKNOWN_TYPE_STRING

        public static final java.lang.String UNKNOWN_TYPE_STRING
        See Also:
        Constant Field Values
      • superTypes

        protected @NonNull java.util.Set<Type> superTypes
      • storage

        protected @NonNull Type.Storage storage
        auto, extern, static, register: consider "auto" as modifier or auto to automatically infer the value.
      • primitive

        protected boolean primitive
    • Constructor Detail

      • Type

        public Type()
      • Type

        public Type​(java.lang.String typeName)
      • Type

        public Type​(Type type)
    • Method Detail

      • getSuperTypes

        public @NonNull java.util.Set<Type> getSuperTypes()
        All direct supertypes of this type.
        Returns:
      • setStorage

        public void setStorage​(@NonNull Type.Storage storage)
      • setQualifier

        public void setQualifier​(Type.Qualifier qualifier)
      • setTypeOrigin

        public void setTypeOrigin​(Type.Origin origin)
      • isPrimitive

        public boolean isPrimitive()
      • reference

        public abstract Type reference​(PointerType.PointerOrigin pointer)
        Parameters:
        pointer - Reason for the reference (array of pointer)
        Returns:
        Returns a reference to the current Type. E.g. when creating a pointer to an existing ObjectType
      • dereference

        public abstract Type dereference()
        Returns:
        Dereferences the current Type by resolving the reference. E.g. when dereferencing an pointer type we obtain the type the pointer is pointing towards
      • refreshNames

        public void refreshNames()
      • getRoot

        public Type getRoot()
        Obtain the root Type Element for a Type Chain (follows Pointer and ReferenceTypes until Object- Incomplete- FunctionPtrType is reached
        Returns:
        root Type
      • setRoot

        public void setRoot​(Type newRoot)
      • duplicate

        public abstract Type duplicate()
        Returns:
        Creates an exact copy of the current type (chain)
      • getTypeName

        public java.lang.String getTypeName()
      • getReferenceDepth

        public int getReferenceDepth()
        Returns:
        number of steps that are required in order to traverse the type chain until the root is reached
      • setAdditionalTypeKeywords

        public void setAdditionalTypeKeywords​(java.lang.String keywords)
      • isFirstOrderType

        public boolean isFirstOrderType()
        Returns:
        True if the Type parameter t is a FirstOrderType (Root of a chain) and not a Pointer or RefrenceType
      • isSimilar

        public boolean isSimilar​(Type t)
        Required for possibleSubTypes to check if the new Type should be considered a subtype or not
        Parameters:
        t - other type the similarity is checked with
        Returns:
        True if the parameter t is equal to the current type (this)
      • equals

        public boolean equals​(java.lang.Object o)
        Overrides:
        equals in class Node
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Node
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class Node