Package dev.frostlake.executor
Class ScopeManager
java.lang.Object
dev.frostlake.executor.ScopeManager
Owns procedural scripting variable state and nested-scope semantics for
ProceduralExecutor:
the variable map plus the scope stack used by BEGIN…END and control-flow blocks. Entering a scope
snapshots the current variables; exiting propagates updates to inherited variables and discards
any newly declared (or shadowed) within that scope.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidEnter a scope that inherits NOTHING and propagates NOTHING — a fresh variable namespace whose exit restores the caller's variables exactly.voidvoidgetVariable(String name) voidCalled when a variable is DECLARED (not just assigned) in the current scope.voidsetVariable(String name, Object value) Live variable map — for raw record-field / session-variable / result-set access.
-
Constructor Details
-
ScopeManager
public ScopeManager()
-
-
Method Details
-
variables
Live variable map — for raw record-field / session-variable / result-set access. -
enterScope
public void enterScope() -
enterIsolatedScope
public void enterIsolatedScope()Enter a scope that inherits NOTHING and propagates NOTHING — a fresh variable namespace whose exit restores the caller's variables exactly. Used for a SQL UDF body: a function is its own execution context, so it can neither read nor clobber the variables of a procedure that calls it (live-verified — a UDF body naming a caller procedure's variable fails "invalid identifier", and a UDF declaring a variable the caller also has leaves the caller's value untouched). -
exitScope
public void exitScope() -
markDeclaredInCurrentScope
Called when a variable is DECLARED (not just assigned) in the current scope. -
setVariable
-
getVariable
-
getAllVariables
-