Class AssemblyParseTreeNode
- java.lang.Object
-
- ghidra.app.plugin.assembler.sleigh.tree.AssemblyParseTreeNode
-
- Direct Known Subclasses:
AssemblyParseBranch
,AssemblyParseToken
public abstract class AssemblyParseTreeNode extends java.lang.Object
A node in a parse tree
-
-
Field Summary
Fields Modifier and Type Field Description protected 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
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract java.lang.String
generateString()
Generate the string that this node parsedAssemblyGrammar
getGrammar()
Get the grammar used to parse the treeAssemblyParseBranch
getParent()
Get the branch which contains this nodeabstract AssemblySymbol
getSym()
Get the symbol for which this node is substituted For a branch, this is the LHS of the corresponding production.boolean
isConstructor()
Check if this node yields a subconstructor resolutionboolean
isNumeric()
Check if this node yields a numeric valuevoid
print(java.io.PrintStream out)
For debugging: Display this parse tree via the given streamprotected abstract void
print(java.io.PrintStream out, java.lang.String indent)
For debugging: Display the tree with the given indentprotected void
setParent(AssemblyParseBranch parent)
Set the branch which contains this node
-
-
-
Field Detail
-
parent
protected AssemblyParseBranch parent
-
grammar
protected final AssemblyGrammar grammar
-
-
Constructor Detail
-
AssemblyParseTreeNode
public AssemblyParseTreeNode(AssemblyGrammar grammar)
Construct a node for a tree parsed by the given grammar- Parameters:
grammar
- the grammar
-
-
Method Detail
-
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(java.io.PrintStream out)
For debugging: Display this parse tree via the given stream- Parameters:
out
- the stream
-
print
protected abstract void print(java.io.PrintStream out, java.lang.String indent)
For debugging: Display the tree with the given indent- Parameters:
out
- the streamindent
- the indent
-
isConstructor
public boolean isConstructor()
Check if this node yields a subconstructor resolution- Returns:
- true if this node yields a subconstructor resolution
-
isNumeric
public boolean isNumeric()
Check if this node yields a numeric value- Returns:
- true if this node yields a numeric value
-
getGrammar
public AssemblyGrammar getGrammar()
Get the grammar used to parse the tree- Returns:
- the grammar
-
generateString
public abstract java.lang.String generateString()
Generate the string that this node parsed- Returns:
- the string
-
-