Package ghidra.program.model.lang.protorules

# Class AssignAction

java.lang.Object
ghidra.program.model.lang.protorules.AssignAction

Direct Known Subclasses:
  `ConsumeAs`, `ConsumeExtra`, `ConvertToPointer`, `GotoStack`, `HiddenReturnAssign`, `MultiMemberAssign`, `MultiSlotAssign`

public abstract class AssignAction extends Object
An action that assigns an Address to a function prototype parameter A request for the address of either return storage or an input parameter is made through the assignAddress() method, which is given full information about the function prototype. Details about how the action performs is configured through the restoreXml() method.

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `static final int`
  `FAIL`
  `static final int`
  `HIDDENRET_PTRPARAM`
  `static final int`
  `HIDDENRET_SPECIALREG`
  `static final int`
  `HIDDENRET_SPECIALREG_VOID`
  `static final int`
  `NO_ASSIGNMENT`
  `protected ParamListStandard`
  `resource`
  `static final int`
  `SUCCESS`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `AssignAction(ParamListStandard res)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `abstract int`
  `assignAddress(DataType dt, PrototypePieces proto, int pos, DataTypeManager dtManager, int[] status, ParameterPieces res)`
  Assign an address and other meta-data for a specific parameter or for return storage in context The Address is assigned based on the data-type of the parameter, available register resources, and other details of the function prototype.
  `abstract AssignAction`
  `clone(ParamListStandard newResource)`
  Make a copy of this action
  `abstract void`
  `encode(Encoder encoder)`
  Save this action and its configuration to a stream
  `abstract boolean`
  `isEquivalent(AssignAction op)`
  Test if the given action is configured and performs identically to this
  `static AssignAction`
  `restoreActionXml(XmlPullParser parser, ParamListStandard res)`
  Read the next action element from the stream and return the new configured AssignAction object.
  `static AssignAction`
  `restoreSideeffectXml(XmlPullParser parser, ParamListStandard res)`
  Read the next sideeffect element from the stream and return the new configured AssignAction object.
  `abstract void`
  `restoreXml(XmlPullParser parser)`
  Configure any details of how this action should behave from the stream

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

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

- ## Field Details

  - ### SUCCESS

    public static final int SUCCESS
    See Also:
      - Constant Field Values

  - ### FAIL

    public static final int FAIL
    See Also:
      - Constant Field Values

  - ### NO_ASSIGNMENT

    public static final int NO_ASSIGNMENT
    See Also:
      - Constant Field Values

  - ### HIDDENRET_PTRPARAM

    public static final int HIDDENRET_PTRPARAM
    See Also:
      - Constant Field Values

  - ### HIDDENRET_SPECIALREG

    public static final int HIDDENRET_SPECIALREG
    See Also:
      - Constant Field Values

  - ### HIDDENRET_SPECIALREG_VOID

    public static final int HIDDENRET_SPECIALREG_VOID
    See Also:
      - Constant Field Values

  - ### resource

    protected ParamListStandard resource

- ## Constructor Details

  - ### AssignAction

    public AssignAction(ParamListStandard res)

- ## Method Details

  - ### clone

    public abstract AssignAction clone(ParamListStandard newResource) throws InvalidInputException
    Make a copy of this action
    Parameters:
      `newResource` - is the new resource object that will own the clone
    Returns:
      the newly allocated copy
    Throws:
      `InvalidInputException` - if required configuration is not present in new resource object

  - ### isEquivalent

    public abstract boolean isEquivalent(AssignAction op)
    Test if the given action is configured and performs identically to this
    Parameters:
      `op` - is the given action
    Returns:
      true if the two actions are equivalent

  - ### assignAddress

    public abstract int assignAddress(DataType dt, PrototypePieces proto, int pos, DataTypeManager dtManager, int[] status, ParameterPieces res)
    Assign an address and other meta-data for a specific parameter or for return storage in context The Address is assigned based on the data-type of the parameter, available register resources, and other details of the function prototype. Consumed resources are marked. This method returns a response code: - SUCCESS - indicating the Address was successfully assigned - FAIL - if the Address could not be assigned - HIDDENRET_PTRPARAM - if an additional hidden return parameter is required
    Parameters:
      `dt` - is the data-type of the parameter or return value
      `proto` - is the high-level description of the function prototype
      `pos` - is the position of the parameter (pos>=0) or return storage (pos=-1)
      `dtManager` - is a data-type manager for (possibly) transforming the data-type
      `status` - is the resource consumption array
      `res` - will hold the resulting description of the parameter
    Returns:
      the response code

  - ### encode

    public abstract void encode(Encoder encoder) throws IOException
    Save this action and its configuration to a stream
    Parameters:
      `encoder` - is the stream encoder
    Throws:
      `IOException` - for problems writing to the stream

  - ### restoreXml

    public abstract void restoreXml(XmlPullParser parser) throws XmlParseException
    Configure any details of how this action should behave from the stream
    Parameters:
      `parser` - is the given stream decoder
    Throws:
      `XmlParseException` - is there are problems decoding the stream

  - ### restoreActionXml

    public static AssignAction restoreActionXml(XmlPullParser parser, ParamListStandard res) throws XmlParseException
    Read the next action element from the stream and return the new configured AssignAction object. If the next element is not an action, throw an exception.
    Parameters:
      `parser` - is the stream parser
      `res` - is the resource set for the new action
    Returns:
      the new action
    Throws:
      `XmlParseException` - for problems parsing the stream

  - ### restoreSideeffectXml

    public static AssignAction restoreSideeffectXml(XmlPullParser parser, ParamListStandard res) throws XmlParseException
    Read the next sideeffect element from the stream and return the new configured AssignAction object. If the next element is not a sideeffect, throw an exception.
    Parameters:
      `parser` - is the stream parser
      `res` - is the resource set for the new sideeffect
    Returns:
      the new sideeffect
    Throws:
      `XmlParseException` - for problems parsing the stream