tools.blend
Class CompareNode

java.lang.Object
  extended by tools.blend.Node
      extended by tools.blend.CompareNode

public class CompareNode
extends Node

A compare-node is where the action takes place in an expression tree. All other nodes just wire up the compare-nodes.


Constructor Summary
CompareNode(Node parent, ParseToken expression, CapNode cap)
          This creates a new CompareNode
 
Method Summary
 ParseToken getExpression()
          This method returns the expression
 java.lang.String getTreeName()
          This returns the name of the construct unique to the tree the node is in.
 java.lang.String toString()
           
 java.lang.String whereDoIGoOnFail()
           
 java.lang.String whereDoIGoOnFail(Node whichChildAmI)
           
 java.lang.String whereDoIGoOnPass()
           
 java.lang.String whereDoIGoOnPass(Node whichChildAmI)
          When a child node finishes its processing it can either have passed or failed and needs a destination to jump to (another compare-node or the pass/fail blocks).
 
Methods inherited from class tools.blend.Node
addChild, getChildIndex, getName, getStartingCompareNode
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CompareNode

public CompareNode(Node parent,
                   ParseToken expression,
                   CapNode cap)
This creates a new CompareNode

Parameters:
parent - the parent node
expression - the expression to generate code for
cap - the root of the expression
Method Detail

getTreeName

public java.lang.String getTreeName()
This returns the name of the construct unique to the tree the node is in.

Returns:
the tree's name

getExpression

public ParseToken getExpression()
This method returns the expression

Returns:
the expression

whereDoIGoOnPass

public java.lang.String whereDoIGoOnPass()

whereDoIGoOnFail

public java.lang.String whereDoIGoOnFail()

whereDoIGoOnPass

public java.lang.String whereDoIGoOnPass(Node whichChildAmI)
Description copied from class: Node
When a child node finishes its processing it can either have passed or failed and needs a destination to jump to (another compare-node or the pass/fail blocks). This method returns the next place.

Specified by:
whereDoIGoOnPass in class Node
Parameters:
whichChildAmI - which child I am (AND and OR have multiple children)
Returns:
the name of the next jump destination

whereDoIGoOnFail

public java.lang.String whereDoIGoOnFail(Node whichChildAmI)
Specified by:
whereDoIGoOnFail in class Node

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object