net.scheinerman.phoenix.interpreter.parser
Class ArgListNode

java.lang.Object
  extended by net.scheinerman.phoenix.interpreter.parser.ArgListNode
All Implemented Interfaces:
ParserTreeNode

public class ArgListNode
extends java.lang.Object
implements ParserTreeNode


Field Summary
private  boolean colonDelineated
           
private  boolean commaDelineated
           
private  java.util.ArrayList<ParserTreeNode> nodes
           
private  boolean parenthesized
           
 
Constructor Summary
ArgListNode()
           
 
Method Summary
 void add(ParserTreeNode node)
           
 int getPrecedence()
          Returns the precedence of the node in the order of operations, when it should be evaluated in the tree.
 Variable[] getVariables()
           
 boolean isColonDelineated()
           
 boolean isCommaDelineated()
           
 boolean isParenthesized()
          Returns true or false based on whether or not this node was encapsulated by parentheses.
 ParserTreeNode left()
          Should be implemented to return the left child node of the current node.
 Variable operate()
          Operates on this node to provide some sort of variable result dependent on the expression being parsed.
 ParserTreeNode right()
          Should be implemented to return the right child node of the current node.
 void setColonDelineated(boolean colonDelineated)
           
 void setCommaDelineated(boolean commaDelineated)
           
 void setParenthesized(boolean parenthesized)
          Sets whether or not this node is encapsulated by parentheses.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

nodes

private java.util.ArrayList<ParserTreeNode> nodes

parenthesized

private boolean parenthesized

commaDelineated

private boolean commaDelineated

colonDelineated

private boolean colonDelineated
Constructor Detail

ArgListNode

public ArgListNode()
Method Detail

isParenthesized

public boolean isParenthesized()
Description copied from interface: ParserTreeNode
Returns true or false based on whether or not this node was encapsulated by parentheses.

Specified by:
isParenthesized in interface ParserTreeNode
Returns:
Whether or not this node was encapsulated by parentheses.

setParenthesized

public void setParenthesized(boolean parenthesized)
Description copied from interface: ParserTreeNode
Sets whether or not this node is encapsulated by parentheses.

Specified by:
setParenthesized in interface ParserTreeNode
Parameters:
parenthesized - - true if this node is surrounded by parentheses, false if not.

isCommaDelineated

public boolean isCommaDelineated()

setCommaDelineated

public void setCommaDelineated(boolean commaDelineated)

isColonDelineated

public boolean isColonDelineated()

setColonDelineated

public void setColonDelineated(boolean colonDelineated)

add

public void add(ParserTreeNode node)

getVariables

public Variable[] getVariables()

operate

public Variable operate()
Description copied from interface: ParserTreeNode
Operates on this node to provide some sort of variable result dependent on the expression being parsed.

Specified by:
operate in interface ParserTreeNode
Returns:
A variable that is the parsed version of this expression.

toString

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

left

public ParserTreeNode left()
Description copied from interface: ParserTreeNode
Should be implemented to return the left child node of the current node.

Specified by:
left in interface ParserTreeNode
Returns:
The left child (the left-hand operand).

right

public ParserTreeNode right()
Description copied from interface: ParserTreeNode
Should be implemented to return the right child node of the current node.

Specified by:
right in interface ParserTreeNode
Returns:
The left child (the right-hand operand).

getPrecedence

public int getPrecedence()
Description copied from interface: ParserTreeNode
Returns the precedence of the node in the order of operations, when it should be evaluated in the tree. The precedence is an integer, the higher the integer, the higher the precedence, meaning that this node will be evaluated sooner than those of lower precedence.

Specified by:
getPrecedence in interface ParserTreeNode
Returns:
A number representing the precedence of this node.