net.sf.saxon.expr

Class LocalVariableReference

public class LocalVariableReference extends VariableReference

Variable reference: a reference to a local variable. This subclass of VariableReference bypasses the Binding object to get the value directly from the relevant slot in the local stackframe.
Field Summary
intslotNumber
Constructor Summary
LocalVariableReference()
Create a local variable reference.
LocalVariableReference(Binding binding)
Create a LocalVariableReference bound to a given Binding
Method Summary
Expressioncopy()
Create a clone copy of this VariableReference
ValueRepresentationevaluateVariable(XPathContext c)
Return the value of the variable
intgetSlotNumber()
Get the slot number allocated to this local variable
voidsetSlotNumber(int slotNumber)
Set the slot number for this local variable, that is, its position in the local stack frame

Field Detail

slotNumber

int slotNumber

Constructor Detail

LocalVariableReference

public LocalVariableReference()
Create a local variable reference. The binding and slot number will be supplied later

LocalVariableReference

public LocalVariableReference(Binding binding)
Create a LocalVariableReference bound to a given Binding

Parameters: binding the binding (that is, the declaration of this local variable)

Method Detail

copy

public Expression copy()
Create a clone copy of this VariableReference

Returns: the cloned copy

evaluateVariable

public ValueRepresentation evaluateVariable(XPathContext c)
Return the value of the variable

Parameters: c the XPath dynamic context

Returns: the value of the variable

Throws: XPathException if any dynamic error occurs while evaluating the variable

getSlotNumber

public int getSlotNumber()
Get the slot number allocated to this local variable

Returns: the slot number

setSlotNumber

public void setSlotNumber(int slotNumber)
Set the slot number for this local variable, that is, its position in the local stack frame

Parameters: slotNumber the slot number to be used