Class to hold compile-time information about an XQuery global variable
or parameter
compile
public GlobalVariable compile(Executable exec,
int slot)
throws XPathException
Create a compiled representation of this global variable
exec
- the executableslot
- the slot number allocated to this variable
- the compiled representation
explain
public void explain(ExpressionPresenter out)
Produce diagnostic output showing the compiled and optimized expression tree for a function
out
- the destination to be used
getColumnNumber
public int getColumnNumber()
Get column number
getCompiledVariable
public GlobalVariable getCompiledVariable()
Get the compiled variable if the definition has been compiled
- the compiled global variable
getLineNumber
public int getLineNumber()
Get the line number where the declaration appears
getPublicId
public String getPublicId()
Get public identifier
getRequiredType
public SequenceType getRequiredType()
Get the required type of the variable
- the declared type, from the "as" clause if present
getSystemId
public String getSystemId()
Get the system ID of the module containing the variable declaration
iterateReferences
public Iterator iterateReferences()
Iterate over the references to this variable
setIsParameter
public void setIsParameter(boolean b)
Indicate whether this global variable is a "parameter" (an external variable, in XQuery terminology)
b
- true if this variable is external
setLineNumber
public void setLineNumber(int lineNumber)
Set the line number where the variable declaration appears in the source
lineNumber
- the line number
setRequiredType
public void setRequiredType(SequenceType type)
Set the required type of the variable
type
- the declared type, from the "as" clause if present
setSystemId
public void setSystemId(String systemId)
Set the system ID of the module where the variable declaration appears
systemId
- the System ID (base URI)
setValueExpression
public void setValueExpression(Expression val)
Set the expression used to define the value of the variable
val
- the initializing expression
setVariableQName
public void setVariableQName(StructuredQName qName)
Set the variable name
qName
- the variable name
typeCheck
public void typeCheck(ExpressionVisitor visitor)
throws XPathException
Type check the compiled representation of this global variable
visitor
- an expression visitor