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

# Class AssemblyParseTreeNode

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

Direct Known Subclasses:
  `AssemblyParseBranch`, `AssemblyParseHiddenNode`, `AssemblyParseToken`

public abstract class AssemblyParseTreeNode extends Object
A node in a parse tree

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `protected final AssemblyGrammar`
  `grammar`
  `protected AssemblyParseBranch`
  `parent`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `AssemblyParseTreeNode(AssemblyGrammar grammar)`
  Construct a node for a tree parsed by the given grammar

- ## Method Summary

  Modifier and Type
  Method
  Description
  `abstract String`
  `generateString()`
  Generate the string that this node parsed
  `AssemblyGrammar`
  `getGrammar()`
  Get the grammar used to parse the tree
  `AssemblyParseBranch`
  `getParent()`
  Get the branch which contains this node
  `abstract AssemblySymbol`
  `getSym()`
  Get the symbol for which this node is substituted
  `void`
  `print(PrintStream out)`
  For debugging: Display this parse tree via the given stream
  `protected abstract void`
  `print(PrintStream out, String indent)`
  For debugging: Display the tree with the given indent
  `protected void`
  `setParent(AssemblyParseBranch parent)`
  Set the branch which contains this node

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

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

- ## Field Details

  - ### parent

    protected AssemblyParseBranch parent

  - ### grammar

    protected final AssemblyGrammar grammar

- ## Constructor Details

  - ### AssemblyParseTreeNode

    public AssemblyParseTreeNode(AssemblyGrammar grammar)
    Construct a node for a tree parsed by the given grammar
    Parameters:
      `grammar` - the grammar

- ## Method Details

  - ### getSym

    public abstract AssemblySymbol getSym()
    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.

    Returns:
      the symbol

  - ### getParent

    public AssemblyParseBranch getParent()
    Get the branch which contains this node
    Returns:

  - ### setParent

    protected void setParent(AssemblyParseBranch parent)
    Set the branch which contains this node
    Parameters:
      `parent` -

  - ### print

    public void print(PrintStream out)
    For debugging: Display this parse tree via the given stream
    Parameters:
      `out` - the stream

  - ### print

    protected abstract void print(PrintStream out, String indent)
    For debugging: Display the tree with the given indent
    Parameters:
      `out` - the stream
      `indent` - the indent

  - ### getGrammar

    public AssemblyGrammar getGrammar()
    Get the grammar used to parse the tree
    Returns:
      the grammar

  - ### generateString

    public abstract String generateString()
    Generate the string that this node parsed
    Returns:
      the string