|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.basex.query.var.VarScope
public final class VarScope
The scope of variables, either the query, a use-defined or an inline function.
Constructor Summary | |
---|---|
VarScope()
Constructor for a top-level module. |
Method Summary | |
---|---|
VarScope |
child()
Get a sub-scope of this scope. |
void |
cleanUp(Scope expr)
Deletes all unused variables from this scope and assigns stack slots. |
void |
close(int marker)
Closes the sub-scope and marks all contained variables as inaccessible. |
java.util.Map<Var,Expr> |
closure()
Get the closure of this scope. |
VarScope |
copy(QueryContext ctx,
VarScope scp,
IntObjMap<Var> vs)
Copies this VarScope. |
int |
enter(QueryContext ctx)
Enters this scope. |
void |
exit(QueryContext ctx,
int fp)
Exits this scope. |
Var |
newCopyOf(QueryContext ctx,
Var var)
Creates a new copy of the given variable in this scope. |
Var |
newLocal(QueryContext ctx,
QNm name,
SeqType typ,
boolean param)
Creates a new local variable in this scope. |
int |
open()
Opens a new sub-scope inside this scope. |
VarScope |
parent()
Parent scope of this scope. |
VarRef |
resolve(QNm name,
QueryContext ctx,
InputInfo ii)
Tries to resolve the given name as a local variable. |
int |
stackSize()
Stack-frame size needed for this scope. |
java.lang.String |
toString()
|
Var |
uniqueVar(QueryContext ctx,
SeqType type,
boolean param)
Creates a variable with a unique, non-clashing variable name. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public VarScope()
Method Detail |
---|
public VarRef resolve(QNm name, QueryContext ctx, InputInfo ii)
name
- variable namectx
- query contextii
- input info
null
otherwisepublic int open()
close(int)
in order to mark the variables
as inaccessible.
public void close(int marker)
marker
- marker for the start of the sub-scopepublic VarScope child()
public VarScope parent()
public Var uniqueVar(QueryContext ctx, SeqType type, boolean param)
ctx
- context for variable IDtype
- typeparam
- function parameter flag
public Var newLocal(QueryContext ctx, QNm name, SeqType typ, boolean param)
ctx
- query contextname
- variable nametyp
- type of the variableparam
- function parameter flag
public Var newCopyOf(QueryContext ctx, Var var)
ctx
- query contextvar
- variable to copy
public java.util.Map<Var,Expr> closure()
public int enter(QueryContext ctx)
ctx
- query context
public void exit(QueryContext ctx, int fp)
ctx
- query contextfp
- frame pointerpublic void cleanUp(Scope expr)
expr
- the scopepublic java.lang.String toString()
toString
in class java.lang.Object
public int stackSize()
public VarScope copy(QueryContext ctx, VarScope scp, IntObjMap<Var> vs)
ctx
- query contextscp
- new parent scopevs
- variable mapping
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |