Package org.basex.query.var
Class QueryStack
java.lang.Object
org.basex.query.var.QueryStack
The query stack, containing local variable bindings of all active scopes.
- Author:
- BaseX Team 2005-21, BSD License, Leo Woerteler
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondump()Creates a dump of the current variable stack.intenterFrame(int size) Enters a new stack frame.voidexitFrame(int frame) Exits a stack frame and makes all bound variables eligible for garbage collection.Gets the value bound to the given variable in the current stack frame.voidreuseFrame(int size) Prepares the current stack frame to be reused.voidset(Var var, Value value, QueryContext qc) Sets the value of the given variable in the current stack frame.toString()
-
Constructor Details
-
QueryStack
public QueryStack()
-
-
Method Details
-
enterFrame
public int enterFrame(int size) Enters a new stack frame.- Parameters:
size- size of this frame- Returns:
- stack pointer of the old frame
-
reuseFrame
public void reuseFrame(int size) Prepares the current stack frame to be reused.- Parameters:
size- new frame size
-
exitFrame
public void exitFrame(int frame) Exits a stack frame and makes all bound variables eligible for garbage collection.- Parameters:
frame- frame pointer of the underlying stack frame
-
get
Gets the value bound to the given variable in the current stack frame.- Parameters:
var- variable- Returns:
- bound value
-
set
Sets the value of the given variable in the current stack frame.- Parameters:
var- variable to bind the value tovalue- value to bindqc- query context- Throws:
QueryException- if the value does not have the right type
-
dump
Creates a dump of the current variable stack.- Returns:
- string dump
-
toString
-