Package org.qdl_lang.evaluate
Class ModuleEvaluator
- java.lang.Object
-
- org.qdl_lang.evaluate.AbstractEvaluator
-
- org.qdl_lang.evaluate.ModuleEvaluator
-
- All Implemented Interfaces:
Serializable
,EvaluatorInterface
public class ModuleEvaluator extends AbstractEvaluator
Created by Jeff Gaynor
on 11/21/23 at 6:42 AM- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.qdl_lang.evaluate.AbstractEvaluator
AbstractEvaluator.CommonKeyIterator, AbstractEvaluator.fPointer, AbstractEvaluator.fpResult
-
-
Field Summary
Fields Modifier and Type Field Description static String
ADD_LIB_ENTRIES
static int
ADD_LIB_ENTRIES_TYPE
static String
DROP
static int
DROP_TYPE
static String
GET_DOCUMENTATION
static int
GET_DOCUMENTATION_TYPE
static String
GET_FUNCTIONS
static int
GET_FUNCTIONS_TYPE
static String
GET_VARIABLES
static int
GET_VARIABLES_TYPE
static String
IMPORT
static String
IMPORT_STATE_ANY
static int
IMPORT_STATE_ANY_VALUE
static String
IMPORT_STATE_NONE
Imported module has completey clean state, nothing from ambient statestatic int
IMPORT_STATE_NONE_VALUE
Used if no state is shared, i.e.static String
IMPORT_STATE_SHARE
Imported module shares ambient state.static int
IMPORT_STATE_SHARE_VALUE
Ambient state used by module.static String
IMPORT_STATE_SNAPSHOT
Imported module gets snapshot of current ambient state, but is independent of it.static int
IMPORT_STATE_SNAPSHOT_VALUE
Am,bient state cloned and then added to module state.static int
IMPORT_TYPE
static String
JAVA_MODULE_LOAD
static int
JAVA_MODULE_LOAD_TYPE
static String
JAVA_MODULE_USE
static int
JAVA_MODULE_USE_TYPE
static String
LOAD
static int
LOAD_TYPE
static String
LOADED
static int
LOADED_TYPE
static int
MODULE_FUNCTION_BASE_VALUE
static String
MODULE_NAMESPACE
static String
RENAME
static int
RENAME_TYPE
static String
USE
static int
USE_TYPE
-
Fields inherited from class org.qdl_lang.evaluate.AbstractEvaluator
bigArgList, bigArgList0, FILE_OP_AUTO, FILE_OP_BINARY, FILE_OP_INPUT_STREAM, FILE_OP_TEXT_INI, FILE_OP_TEXT_STEM, FILE_OP_TEXT_STRING, FILE_OP_TEXT_WITHOUT_LIST_INI, fNames, MAX_ARG_COUNT
-
Fields inherited from interface org.qdl_lang.evaluate.EvaluatorInterface
UNKNOWN_VALUE
-
-
Constructor Summary
Constructors Constructor Description ModuleEvaluator()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected FStack
cloneIntrinsicFunctions(State state)
protected VStack
cloneIntrinsicVariables(State state)
boolean
dispatch(Polyad polyad, State state)
Does the actual evaluation of thePolyad
.protected void
doImport(Polyad polyad, State state)
Eithjer import(string) - namespace import(string, mode) - mode is a string or integer returns the instance of the module.protected void
doLoad(Polyad polyad, State state)
Contract is that the type as an explicit argument is no longer required.protected void
doUse(Polyad polyad, State state)
protected String
getClassPathFromToolPath(List<String> toolPath, State state)
protected QDLStem
getDoc(DyadicFunctionReferenceNode df)
protected QDLStem
getDoc(Module m)
protected QDLStem
getDoc(QDLStem inStem)
String[]
getFunctionNames()
static String
getInheritanceMode(int x)
static int
getInheritanceMode(String x)
String
getNamespace()
int
getType(String name)
-
Methods inherited from class org.qdl_lang.evaluate.AbstractEvaluator
areAllBigDecimals, areAllBoolean, areAllLongs, areAllNumbers, areAllSets, areAllStems, areAllStrings, areAnyBigDecimals, areNoneStems, bdEquals, checkNull, checkNull, convertArgsToStem, evaluate, evaluate, finishExpr, getBigArgList, getBigArgList0, getCommonKeys, getFQFunctionNames, getFunctionReferenceNode, getFunctionReferenceNode, getOperator, getOrCreateStem, isBigDecimal, isBoolean, isBuiltInFunction, isFunctionRef, isLong, isNumber, isScalar, isSet, isStem, isStemList, isString, listFunctions, process1, process2, process2, process3, processSet1, processSet2, processSet2, processStem1, processStem2, processStem3, resolveResourceToFile, tempFname, toBD, toConstants, toStem
-
-
-
-
Field Detail
-
MODULE_NAMESPACE
public static final String MODULE_NAMESPACE
- See Also:
- Constant Field Values
-
MODULE_FUNCTION_BASE_VALUE
public static final int MODULE_FUNCTION_BASE_VALUE
- See Also:
- Constant Field Values
-
LOAD
public static final String LOAD
- See Also:
- Constant Field Values
-
LOAD_TYPE
public static final int LOAD_TYPE
- See Also:
- Constant Field Values
-
IMPORT
public static final String IMPORT
- See Also:
- Constant Field Values
-
IMPORT_TYPE
public static final int IMPORT_TYPE
- See Also:
- Constant Field Values
-
USE
public static final String USE
- See Also:
- Constant Field Values
-
USE_TYPE
public static final int USE_TYPE
- See Also:
- Constant Field Values
-
DROP
public static final String DROP
- See Also:
- Constant Field Values
-
DROP_TYPE
public static final int DROP_TYPE
- See Also:
- Constant Field Values
-
RENAME
public static final String RENAME
- See Also:
- Constant Field Values
-
RENAME_TYPE
public static final int RENAME_TYPE
- See Also:
- Constant Field Values
-
GET_FUNCTIONS
public static final String GET_FUNCTIONS
- See Also:
- Constant Field Values
-
GET_FUNCTIONS_TYPE
public static final int GET_FUNCTIONS_TYPE
- See Also:
- Constant Field Values
-
GET_VARIABLES
public static final String GET_VARIABLES
- See Also:
- Constant Field Values
-
GET_VARIABLES_TYPE
public static final int GET_VARIABLES_TYPE
- See Also:
- Constant Field Values
-
GET_DOCUMENTATION
public static final String GET_DOCUMENTATION
- See Also:
- Constant Field Values
-
GET_DOCUMENTATION_TYPE
public static final int GET_DOCUMENTATION_TYPE
- See Also:
- Constant Field Values
-
LOADED
public static final String LOADED
- See Also:
- Constant Field Values
-
LOADED_TYPE
public static final int LOADED_TYPE
- See Also:
- Constant Field Values
-
JAVA_MODULE_LOAD
public static final String JAVA_MODULE_LOAD
- See Also:
- Constant Field Values
-
JAVA_MODULE_LOAD_TYPE
public static final int JAVA_MODULE_LOAD_TYPE
- See Also:
- Constant Field Values
-
JAVA_MODULE_USE
public static final String JAVA_MODULE_USE
- See Also:
- Constant Field Values
-
JAVA_MODULE_USE_TYPE
public static final int JAVA_MODULE_USE_TYPE
- See Also:
- Constant Field Values
-
ADD_LIB_ENTRIES
public static final String ADD_LIB_ENTRIES
- See Also:
- Constant Field Values
-
ADD_LIB_ENTRIES_TYPE
public static final int ADD_LIB_ENTRIES_TYPE
- See Also:
- Constant Field Values
-
IMPORT_STATE_NONE
public static final String IMPORT_STATE_NONE
Imported module has completey clean state, nothing from ambient state- See Also:
- Constant Field Values
-
IMPORT_STATE_SNAPSHOT
public static final String IMPORT_STATE_SNAPSHOT
Imported module gets snapshot of current ambient state, but is independent of it.- See Also:
- Constant Field Values
-
IMPORT_STATE_SHARE
public static final String IMPORT_STATE_SHARE
Imported module shares ambient state. Any changes to ambient state are reflected in module's state.- See Also:
- Constant Field Values
-
IMPORT_STATE_ANY
public static final String IMPORT_STATE_ANY
- See Also:
- Constant Field Values
-
IMPORT_STATE_NONE_VALUE
public static final int IMPORT_STATE_NONE_VALUE
Used if no state is shared, i.e. completely clean state in the module (default)- See Also:
- Constant Field Values
-
IMPORT_STATE_SNAPSHOT_VALUE
public static final int IMPORT_STATE_SNAPSHOT_VALUE
Am,bient state cloned and then added to module state.- See Also:
- Constant Field Values
-
IMPORT_STATE_SHARE_VALUE
public static final int IMPORT_STATE_SHARE_VALUE
Ambient state used by module. Note that this causes serialization problems potentially...- See Also:
- Constant Field Values
-
IMPORT_STATE_ANY_VALUE
public static final int IMPORT_STATE_ANY_VALUE
- See Also:
- Constant Field Values
-
-
Method Detail
-
getNamespace
public String getNamespace()
-
getFunctionNames
public String[] getFunctionNames()
- Specified by:
getFunctionNames
in classAbstractEvaluator
-
getType
public int getType(String name)
-
dispatch
public boolean dispatch(Polyad polyad, State state)
Description copied from class:AbstractEvaluator
Does the actual evaluation of thePolyad
.- Specified by:
dispatch
in classAbstractEvaluator
- Returns:
-
getDoc
protected QDLStem getDoc(DyadicFunctionReferenceNode df)
-
doLoad
protected void doLoad(Polyad polyad, State state)
Contract is that the type as an explicit argument is no longer required. Assumption is that a file is being loaded and if that fails, then the request is for a Java class. This accepts a single value or stem of them.- Parameters:
polyad
-state
-
-
getInheritanceMode
public static String getInheritanceMode(int x)
-
getInheritanceMode
public static int getInheritanceMode(String x)
-
doImport
protected void doImport(Polyad polyad, State state)
Eithjer- import(string) - namespace
- import(string, mode) - mode is a string or integer
- Parameters:
polyad
-state
-
-
cloneIntrinsicVariables
protected VStack cloneIntrinsicVariables(State state) throws Throwable
- Throws:
Throwable
-
cloneIntrinsicFunctions
protected FStack cloneIntrinsicFunctions(State state) throws Throwable
- Throws:
Throwable
-
-