Package ghidra.program.model.lang
Class RegisterTree
java.lang.Object
ghidra.program.model.lang.RegisterTree
- All Implemented Interfaces:
Comparable<RegisterTree>
The RegisterTree class builds and represents relationships between registers. Any
register that "breaks down" into smaller registers can be represent by a
RegisterTree. The largest register will be at the root and the registers that
make it up will be its children trees. The children are RegisterTrees as well
and can have children trees of thier own. The root of a RegisterTree may not
have an associated Register which means that its children are unrelated. This
way all the registers of a processor can be represented as a single RegisterTree.
-
Constructor Summary
ConstructorDescriptionRegisterTree
(Register reg) RegisterTree
(String name, Register[] regs) Constructs a RegisterTree with the given name and set of registersRegisterTree
(String name, RegisterTree tree) Constructs a RegisterTree with one RegisterTree child -
Method Summary
Modifier and TypeMethodDescriptionvoid
add
(RegisterTree tree) Adds a Register Tree to this tree.int
compareTo
(RegisterTree other) Get the RegisterTrees that are the children of this RegisterTreegetName()
Returns the name of this register tree.Returns the parent RegisterTree.The parent path of this RegisterTree if it exists or null if this tree has no parent or no parent with a register.Returns the Register associated with this tree.The path of this register, which includes the parent path of this RegisterTree if this RegisterTree has a parent.getRegisterTree
(Register register1) Returns the RegisterTree for the given register if one exists in this RegisterTree object.void
Removes the register from the childrentoString()
-
Constructor Details
-
RegisterTree
-
RegisterTree
Constructs a RegisterTree with the given name and set of registers- Parameters:
name
- the name of the treeregs
- the array of registers to form into a tree
-
RegisterTree
Constructs a RegisterTree with one RegisterTree child- Parameters:
name
- the name of this treetree
- the child tree.
-
-
Method Details
-
getName
Returns the name of this register tree. -
add
Adds a Register Tree to this tree.- Parameters:
tree
- the register tree to add
-
getComponents
Get the RegisterTrees that are the children of this RegisterTree- Returns:
- a array of RegisterTrees
-
getRegister
Returns the Register associated with this tree. This may be null which indicates the children RegisterTrees are unrelated to each other. -
getParent
Returns the parent RegisterTree. -
getParentRegisterPath
The parent path of this RegisterTree if it exists or null if this tree has no parent or no parent with a register.- Returns:
- The parent path of this RegisterTree.
-
getRegisterPath
The path of this register, which includes the parent path of this RegisterTree if this RegisterTree has a parent.- Returns:
- the path of this register.
-
getRegisterTree
Returns the RegisterTree for the given register if one exists in this RegisterTree object.- Parameters:
register1
- The register for which to get a RegisterTree.- Returns:
- The RegisterTree for the given register if one exists in this RegisterTree object.
-
compareTo
- Specified by:
compareTo
in interfaceComparable<RegisterTree>
- See Also:
-
remove
Removes the register from the children- Parameters:
reg
- the register to remove.
-
toString
-