net.sf.joost.grammar.tree
Class VarTree
java.lang.Object
net.sf.joost.grammar.Tree
net.sf.joost.grammar.tree.VarTree
- All Implemented Interfaces:
- Cloneable
public final class VarTree
- extends Tree
Objects of VarTree represent variable reference ('$var') nodes in the
syntax tree of a pattern or an STXPath expression.
- Version:
- $Revision: 1.6 $ $Date: 2008/10/04 17:13:14 $
- Author:
- Oliver Becker
Fields inherited from class net.sf.joost.grammar.Tree |
ADD, AND, ATTR, ATTR_LOCAL_WILDCARD, ATTR_URI_WILDCARD, ATTR_WILDCARD, AVT, CDATA_TEST, CHILD, COMMENT_TEST, DDOT, DESC, DIV, DOT, EQ, FUNCTION, GE, GT, LE, left, LIST, lName, LOCAL_WILDCARD, LT, MOD, MULT, NAME_TEST, NE, NODE_TEST, NUMBER, OR, PI_TEST, PREDICATE, right, ROOT, SEQ, STRING, SUB, TEXT_TEST, type, UNION, uri, URI_WILDCARD, value, VALUE, VAR, WILDCARD |
expName
private final String expName
- The expanded name of the variable
scopeDetermined
private boolean scopeDetermined
groupScope
private GroupBase groupScope
VarTree
public VarTree(String value,
ParseContext context)
throws SAXParseException
- Throws:
SAXParseException
evaluate
public Value evaluate(Context context,
int top)
throws SAXException
- Description copied from class:
Tree
- Evaluates the current Tree if it represents an expression.
- Overrides:
evaluate
in class Tree
- Parameters:
context
- the current Contexttop
- the part of the stack to be considered for the evaluation
(the upper most element is at position top-1)
- Returns:
- a new computed Value object containing the result
- Throws:
SAXException
isConstant
public boolean isConstant()
- Overrides:
isConstant
in class Tree
- Returns:
- whether the expression represented by this tree is constant
deepCopy
public Tree deepCopy(HashMap copies)
- Description copied from class:
Tree
- Creates a deep copy of this Tree
- Overrides:
deepCopy
in class Tree
- Parameters:
copies
- the map of already copied objects that need to be remembered
(mainly of AbstractInstruction
)
- Returns:
- the created copy