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 Details

  • 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