Class SymbolType


  • public abstract class SymbolType
    extends java.lang.Object
    Class to represent the various types of Symbols.
    • Field Detail

      • CODE

        @Deprecated(since="9.1",
                    forRemoval=true)
        public static final SymbolType CODE
        Deprecated, for removal: This API element is subject to removal in a future version.
        use LABEL instead.
      • NAMESPACE

        public static final SymbolType NAMESPACE
      • FUNCTION

        public static final SymbolType FUNCTION
      • PARAMETER

        public static final SymbolType PARAMETER
      • LOCAL_VAR

        public static final SymbolType LOCAL_VAR
      • GLOBAL_VAR

        public static final SymbolType GLOBAL_VAR
    • Method Detail

      • isValidParent

        public abstract boolean isValidParent​(Program program,
                                              Namespace parent,
                                              Address symbolAddr,
                                              boolean isExternalSymbol)
        Returns true if the given namespace is a valid parent for a symbol of this type if it has the given address and whether or not it is external.
        Parameters:
        program - the program to contain the symbol
        parent - the namespace where a symbol will potentially be parented.
        symbolAddr - the address of they symbol to be parented.
        isExternalSymbol - true if the symbol is external.
        Returns:
        true if the given namespace is a valid parent for a symbol if it has the given address and whether or not it is external.
      • isValidAddress

        public abstract boolean isValidAddress​(Program program,
                                               Address symbolAddress)
        Returns true if the given address is valid for this symbol type.
        Parameters:
        program - the program to test for a valid address.
        symbolAddress - the address of the symbol to be tested.
        Returns:
        true if the given address is valid within the given program.
      • isValidSourceType

        public abstract boolean isValidSourceType​(SourceType sourceType,
                                                  Address symbolAddress)
        Returns true if the given SourceType is valid for this symbol type. (For example, Some symbols don't support the SymbolType.DEFAULT)
        Parameters:
        sourceType - the sourceType to test.
        symbolAddress - the address of the symbol to be tested.
        Returns:
        true if the given SourceType is valid for this symbol type.
      • allowsDuplicates

        public boolean allowsDuplicates()
        Returns true of this symbol type allows duplicate names.
        Returns:
        true of this symbol type allows duplicate names.
      • isNamespace

        public boolean isNamespace()
        Returns true if this symbol represents a namespace.
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • getID

        public byte getID()
        Returns the id of this symbol type.
      • getSymbolType

        public static SymbolType getSymbolType​(int id)
        Returns the SymbolType for the given id.
        Parameters:
        id - the id for the SymbolType to find.
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • equals

        public boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object