Package ghidra.program.model.pcode

# Class HighConstant

java.lang.Object
ghidra.program.model.pcode.HighVariable
ghidra.program.model.pcode.HighConstant

public class HighConstant extends HighVariable
A constant that has been given a datatype (like a constant that is really a pointer)

- ## Field Summary

  ### Fields inherited from class ghidra.program.model.pcode.HighVariable

  `function, instances, name, offset, represent, type`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `HighConstant(HighFunction func)`
  Constructor for use with restoreXml
  `HighConstant(String name, DataType type, Varnode vn, Address pc, HighFunction func)`
  Construct a constant NOT associated with a symbol

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `decode(Decoder decoder)`
  Decode this HighVariable from a `<high>` element in the stream
  `Address`
  `getPCAddress()`
  `Scalar`
  `getScalar()`
  `HighSymbol`
  `getSymbol()`
  Retrieve any underlying HighSymbol

  ### Methods inherited from class ghidra.program.model.pcode.HighVariable

  `attachInstances, decodeInstances, getDataType, getHighFunction, getInstances, getName, getOffset, getRepresentative, getSize, requiresDynamicStorage, setHighOnInstances`

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### HighConstant

    public HighConstant(HighFunction func)
    Constructor for use with restoreXml
    Parameters:
      `func` - is the HighFunction this constant belongs to

  - ### HighConstant

    public HighConstant(String name, DataType type, Varnode vn, Address pc, HighFunction func)
    Construct a constant NOT associated with a symbol
    Parameters:
      `name` - name of variable
      `type` - data type of variable
      `vn` - constant varnode
      `pc` - code unit address where constant is used
      `func` - the associated high function

- ## Method Details

  - ### getSymbol

    public HighSymbol getSymbol()
    Description copied from class: `HighVariable`
    Retrieve any underlying HighSymbol
    Specified by:
      `getSymbol` in class `HighVariable`
    Returns:
      the HighSymbol

  - ### getPCAddress

    public Address getPCAddress()
    Returns:
      instruction address the variable comes into scope within the function

  - ### getScalar

    public Scalar getScalar()
    Returns:
      constant as a scalar object

  - ### decode

    public void decode(Decoder decoder) throws DecoderException
    Description copied from class: `HighVariable`
    Decode this HighVariable from a `<high>` element in the stream
    Specified by:
      `decode` in class `HighVariable`
    Parameters:
      `decoder` - is the stream decoder
    Throws:
      `DecoderException` - for invalid encodings