final class BURS_IntConstantTreeNode extends AbstractBURS_TreeNode
It is very common for us to want to access the value of an int constant during BURS, so we make it easy to do so by creating a special kind of node.
Modifier and Type | Field and Description |
---|---|
private AbstractBURS_TreeNode |
delegate
Where costs and rules are stored
|
(package private) int |
value
The int constant value associated with this tree node
|
child1, child2, dg_node
Constructor and Description |
---|
BURS_IntConstantTreeNode(int val)
Constructor for interior node.
|
Modifier and Type | Method and Description |
---|---|
char |
getCost(int goalNT) |
void |
initCost() |
int |
readPacked(int word,
int shift,
int mask) |
int |
rule(int goalNT)
Gets the BURS rule number associated with this tree node for a given non-terminal
|
void |
setCost(int goalNT,
char cost) |
String |
toString() |
void |
writePacked(int word,
int mask,
int shiftedValue) |
create, create, getChild1, getChild2, getInstruction, getInstructionString, getNonTerminal, getOpcode, isREGISTERNode, isSuperNodeRoot, isTreeRoot, numRegisters, setChild1, setChild2, setNonTerminal, setNumRegisters, setTreeRoot
final int value
private final AbstractBURS_TreeNode delegate
BURS_IntConstantTreeNode(int val)
val
- a constant int valuepublic String toString()
toString
in class AbstractBURS_TreeNode
public int rule(int goalNT)
rule
in class AbstractBURS_TreeNode
goalNT
- the non-terminal we want to know the rule for (e.g. stm_NT)public char getCost(int goalNT)
getCost
in class AbstractBURS_TreeNode
public void setCost(int goalNT, char cost)
setCost
in class AbstractBURS_TreeNode
public void initCost()
initCost
in class AbstractBURS_TreeNode
public void writePacked(int word, int mask, int shiftedValue)
writePacked
in class AbstractBURS_TreeNode
public int readPacked(int word, int shift, int mask)
readPacked
in class AbstractBURS_TreeNode