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 StringADD_LIB_ENTRIESstatic intADD_LIB_ENTRIES_TYPEstatic StringDROPstatic intDROP_TYPEstatic StringGET_DOCUMENTATIONstatic intGET_DOCUMENTATION_TYPEstatic StringGET_FUNCTIONSstatic intGET_FUNCTIONS_TYPEstatic StringGET_VARIABLESstatic intGET_VARIABLES_TYPEstatic StringIMPORTstatic StringIMPORT_STATE_ANYstatic intIMPORT_STATE_ANY_VALUEstatic StringIMPORT_STATE_NONEImported module has completey clean state, nothing from ambient statestatic intIMPORT_STATE_NONE_VALUEUsed if no state is shared, i.e.static StringIMPORT_STATE_SHAREImported module shares ambient state.static intIMPORT_STATE_SHARE_VALUEAmbient state used by module.static StringIMPORT_STATE_SNAPSHOTImported module gets snapshot of current ambient state, but is independent of it.static intIMPORT_STATE_SNAPSHOT_VALUEAm,bient state cloned and then added to module state.static intIMPORT_TYPEstatic StringJAVA_MODULE_LOADstatic intJAVA_MODULE_LOAD_TYPEstatic StringJAVA_MODULE_USEstatic intJAVA_MODULE_USE_TYPEstatic StringLOADstatic intLOAD_TYPEstatic StringLOADEDstatic intLOADED_TYPEstatic intMODULE_FUNCTION_BASE_VALUEstatic StringMODULE_NAMESPACEstatic StringRENAMEstatic intRENAME_TYPEstatic StringUSEstatic intUSE_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 FStackcloneIntrinsicFunctions(State state)protected VStackcloneIntrinsicVariables(State state)booleandispatch(Polyad polyad, State state)Does the actual evaluation of thePolyad.protected voiddoImport(Polyad polyad, State state)Eithjer import(string) - namespace import(string, mode) - mode is a string or integer returns the instance of the module.protected voiddoLoad(Polyad polyad, State state)Contract is that the type as an explicit argument is no longer required.protected voiddoUse(Polyad polyad, State state)protected StringgetClassPathFromToolPath(List<String> toolPath, State state)protected QDLStemgetDoc(Module m)protected QDLStemgetDoc(DyadicFunctionReferenceNode df)protected QDLStemgetDoc(QDLStem inStem)String[]getFunctionNames()static StringgetInheritanceMode(int x)static intgetInheritanceMode(String x)StringgetNamespace()intgetType(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, NEWgetOperator, OLDgetOperator, 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:
getFunctionNamesin classAbstractEvaluator
-
getType
public int getType(String name)
-
dispatch
public boolean dispatch(Polyad polyad, State state)
Description copied from class:AbstractEvaluatorDoes the actual evaluation of thePolyad.- Specified by:
dispatchin 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
-
-