Package org.qdl_lang.state
Class VariableState
- java.lang.Object
-
- org.qdl_lang.state.AbstractState
-
- org.qdl_lang.state.ModuleState
-
- org.qdl_lang.state.NamespaceAwareState
-
- org.qdl_lang.state.VariableState
-
- All Implemented Interfaces:
edu.uiuc.ncsa.security.core.Logable
,edu.uiuc.ncsa.security.util.scripting.StateInterface
,Serializable
- Direct Known Subclasses:
FunctionState
public abstract class VariableState extends NamespaceAwareState
Created by Jeff Gaynor
on 2/2/20 at 6:42 AM- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
VariableState.CyclicalError
Thrown byVariableState.ResolveState
if a cycle is found.static class
VariableState.ResolveState
-
Field Summary
Fields Modifier and Type Field Description static String
EXTRINSIC_MARKER
static String
int_regex
static String
var_regex
-
Fields inherited from class org.qdl_lang.state.NamespaceAwareState
NS_DELIMITER, RESERVED_NAMESPACE
-
Fields inherited from class org.qdl_lang.state.ModuleState
MTemplates
-
Fields inherited from class org.qdl_lang.state.AbstractState
INTRINSIC_PREFIX, libPath, scriptArgs
-
-
Constructor Summary
Constructors Constructor Description VariableState(VStack vStack, OpEvaluator opEvaluator, MetaEvaluator metaEvaluator, MTStack mtStack, MIStack miStack, edu.uiuc.ncsa.security.core.util.MyLoggingFacade myLoggingFacade)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description VStack
getExtrinsicVars()
VStack
getIntrinsicVariables()
Object
getValue(String variableName)
GetValue may return null if the variable has not been set.Object
getValue(String variableName, Set<XKey> checkedAliases)
protected Object
gsrNSScalarOp(String variableName, int op, Object value, Set<XKey> checkedAliases)
protected Object
gsrNSStemOp(StemMultiIndex w, int op, Object value, Set<XKey> checkInstances)
gsr = get, set or remove.boolean
isDefined(String symbol)
Checks if a symbol is defined.static boolean
isExtrinsic(String x)
boolean
isStem(String var)
TreeSet<String>
listVariables(boolean useCompactNotation, boolean includeModules, boolean showIntrinsic, boolean showExtrinsic)
void
remove(String variableName)
protected String
resolveStemIndex(String index)
protected String
resolveStemIndex(String index, VariableState.ResolveState resolveState)
void
setIntrinsicVariables(VStack instrinsicVariables)
void
setValue(String variableName, Object value)
void
setValue(String variableName, Object value, Set<XKey> checkedAliases)
-
Methods inherited from class org.qdl_lang.state.NamespaceAwareState
getAlias, getUNQName
-
Methods inherited from class org.qdl_lang.state.ModuleState
getImportedModule, getMInstances, getModule, getMTemplates, getUsedModules, hasModule, isImportMode, isModuleState, setImportMode, setMInstances, setModule, setModuleState, setMTemplates, setUsedModules
-
Methods inherited from class org.qdl_lang.state.AbstractState
debug, error, error, error, getIoInterface, getLibPath, getLogger, getMetaEvaluator, getModulePaths, getOperatorType, getOpEvaluator, getScriptArgs, getScriptArgStem, getScriptName, getScriptPaths, getScriptStack, getStateRegistry, getSuperState, getUuid, getVStack, hasLogging, hasScriptArgs, hasScriptName, hasSuperState, info, isDebugOn, isEnableLibrarySupport, isIntrinsic, isPrintUnicode, pathToList, setDebugOn, setEnableLibrarySupport, setIoInterface, setLibPath, setLibPath, setLogger, setMetaEvaluator, setModulePaths, setModulePaths, setOpEvaluator, setPrintUnicode, setScriptArgs, setScriptArgStem, setScriptName, setScriptPaths, setScriptPaths, setScriptStack, setSuperState, setUuid, setvStack, warn
-
-
-
-
Field Detail
-
var_regex
public static String var_regex
-
int_regex
public static String int_regex
-
EXTRINSIC_MARKER
public static final String EXTRINSIC_MARKER
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
VariableState
public VariableState(VStack vStack, OpEvaluator opEvaluator, MetaEvaluator metaEvaluator, MTStack mtStack, MIStack miStack, edu.uiuc.ncsa.security.core.util.MyLoggingFacade myLoggingFacade)
-
-
Method Detail
-
isDefined
public boolean isDefined(String symbol)
Checks if a symbol is defined. Note that this does do stem tail resolution and namespace resolution.- Parameters:
symbol
-- Returns:
-
getValue
public Object getValue(String variableName)
GetValue may return null if the variable has not been set.- Parameters:
variableName
-- Returns:
-
remove
public void remove(String variableName)
-
gsrNSStemOp
protected Object gsrNSStemOp(StemMultiIndex w, int op, Object value, Set<XKey> checkInstances)
gsr = get, set or remove. This resolves the name of the- Parameters:
w
-op
-value
-- Returns:
-
gsrNSScalarOp
protected Object gsrNSScalarOp(String variableName, int op, Object value, Set<XKey> checkedAliases)
-
resolveStemIndex
protected String resolveStemIndex(String index, VariableState.ResolveState resolveState)
-
listVariables
public TreeSet<String> listVariables(boolean useCompactNotation, boolean includeModules, boolean showIntrinsic, boolean showExtrinsic)
-
isStem
public boolean isStem(String var)
-
isExtrinsic
public static boolean isExtrinsic(String x)
-
getExtrinsicVars
public VStack getExtrinsicVars()
-
setIntrinsicVariables
public void setIntrinsicVariables(VStack instrinsicVariables)
-
getIntrinsicVariables
public VStack getIntrinsicVariables()
-
-