Package ghidra.app.plugin.assembler.sleigh.parse

# Class AssemblyParseState

java.lang.Object
ghidra.app.plugin.assembler.sleigh.parse.AssemblyParseState

All Implemented Interfaces:
  `Comparable<AssemblyParseState>`

public class AssemblyParseState extends Object implements Comparable<AssemblyParseState>
A state in an LR(0) parsing machine

Each item consists of a kernel and an implied closure. Only the kernel is necessary to define the item, but the whole closure must be considered when deriving new states. The kernel can be retrieved and mutated via `getKernel()`, then the closure derived from it via `getClosure()`.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `AssemblyParseState(AssemblyGrammar grammar)`
  Construct a new state associated with the given grammar
  `AssemblyParseState(AssemblyGrammar grammar, AssemblyParseStateItem item)`
  Construct a new state associated with the given grammar, seeded with the given item

- ## Method Summary

  Modifier and Type
  Method
  Description
  `int`
  `compareTo(AssemblyParseState that)`
  `boolean`
  `equals(Object that)`
  `Set<AssemblyParseStateItem>`
  `getClosure()`
  Get the closure of this item, caching the result
  `Set<AssemblyParseStateItem>`
  `getKernel()`
  Get the (mutable) kernel for this state
  `int`
  `hashCode()`
  `String`
  `toString()`

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

  `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

- ## Constructor Details

  - ### AssemblyParseState

    public AssemblyParseState(AssemblyGrammar grammar)
    Construct a new state associated with the given grammar
    Parameters:
      `grammar` - the grammar

  - ### AssemblyParseState

    public AssemblyParseState(AssemblyGrammar grammar, AssemblyParseStateItem item)
    Construct a new state associated with the given grammar, seeded with the given item
    Parameters:
      `grammar` - the grammar
      `item` - an item in the state

- ## Method Details

  - ### getKernel

    public Set<AssemblyParseStateItem> getKernel()
    Get the (mutable) kernel for this state
    Returns:
      the kernel

  - ### getClosure

    public Set<AssemblyParseStateItem> getClosure()
    Get the closure of this item, caching the result
    Returns:
      the closure

  - ### equals

    public boolean equals(Object that)
    Overrides:
      `equals` in class `Object`

  - ### compareTo

    public int compareTo(AssemblyParseState that)
    Specified by:
      `compareTo` in interface `Comparable<AssemblyParseState>`

  - ### toString

    public String toString()
    Overrides:
      `toString` in class `Object`

  - ### hashCode

    public int hashCode()
    Overrides:
      `hashCode` in class `Object`