Package ghidra.app.plugin.assembler.sleigh.tree

# Class AssemblyParseToken

java.lang.Object
ghidra.app.plugin.assembler.sleigh.tree.AssemblyParseTreeNode
ghidra.app.plugin.assembler.sleigh.tree.AssemblyParseToken

Direct Known Subclasses:
  `AssemblyParseNumericToken`, `AssemblySentential.WhiteSpaceParseToken`

public class AssemblyParseToken extends AssemblyParseTreeNode
A string token

See Also:
  - `AssemblyStringTerminal`

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `protected final String`
  `str`
  `protected final AssemblyTerminal`
  `term`

  ### Fields inherited from class ghidra.app.plugin.assembler.sleigh.tree.AssemblyParseTreeNode

  `grammar, parent`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `AssemblyParseToken(AssemblyGrammar grammar, AssemblyTerminal term, String str)`
  Construct a new token having the given string value

- ## Method Summary

  Modifier and Type
  Method
  Description
  `boolean`
  `equals(Object obj)`
  `String`
  `generateString()`
  Generate the string that this node parsed
  `String`
  `getString()`
  Get the portion of the input comprising the token
  `AssemblyTerminal`
  `getSym()`
  Get the symbol for which this node is substituted
  `int`
  `hashCode()`
  `protected void`
  `print(PrintStream out, String indent)`
  For debugging: Display the tree with the given indent
  `String`
  `toString()`

  ### Methods inherited from class ghidra.app.plugin.assembler.sleigh.tree.AssemblyParseTreeNode

  `getGrammar, getParent, print, setParent`

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

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

- ## Field Details

  - ### term

    protected final AssemblyTerminal term

  - ### str

    protected final String str

- ## Constructor Details

  - ### AssemblyParseToken

    public AssemblyParseToken(AssemblyGrammar grammar, AssemblyTerminal term, String str)
    Construct a new token having the given string value
    Parameters:
      `grammar` - the grammar containing the terminal
      `term` - the terminal that matched this token
      `str` - the portion of the input comprising this token

- ## Method Details

  - ### hashCode

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

  - ### equals

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

  - ### getString

    public String getString()
    Get the portion of the input comprising the token
    Returns:
      the string value

  - ### getSym

    public AssemblyTerminal getSym()
    Description copied from class: `AssemblyParseTreeNode`
    Get the symbol for which this node is substituted

    For a branch, this is the LHS of the corresponding production. For a token, this is the terminal whose tokenizer matched it.

    Specified by:
      `getSym` in class `AssemblyParseTreeNode`
    Returns:
      the symbol

  - ### print

    protected void print(PrintStream out, String indent)
    Description copied from class: `AssemblyParseTreeNode`
    For debugging: Display the tree with the given indent
    Specified by:
      `print` in class `AssemblyParseTreeNode`
    Parameters:
      `out` - the stream
      `indent` - the indent

  - ### toString

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

  - ### generateString

    public String generateString()
    Description copied from class: `AssemblyParseTreeNode`
    Generate the string that this node parsed
    Specified by:
      `generateString` in class `AssemblyParseTreeNode`
    Returns:
      the string