Package org.qdl_lang.evaluate
Class FunctionEvaluator
- java.lang.Object
-
- org.qdl_lang.evaluate.AbstractEvaluator
-
- org.qdl_lang.evaluate.FunctionEvaluator
-
- All Implemented Interfaces:
Serializable
,EvaluatorInterface
public class FunctionEvaluator extends AbstractEvaluator
Created by Jeff Gaynor
on 1/22/20 at 10:53 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
APPLY
static int
APPLY_TYPE
static String
ARG_COUNT
static int
ARG_COUNT_TYPE
static int
BASE_FUNCTION_VALUE
static String
DUMMY_BUILT_IN_FUNCTION_NAME_CAPUT
static String
FUNCTION_NAMESPACE
static String
IS_FUNCTION
static int
IS_FUNCTION_TYPE
static String
NAMES
static int
NAMES_TYPE
static long
serialVersionUID
-
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 FunctionEvaluator()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected Boolean
checkIsFunction(String fName, int argCount, State state)
protected String[]
dereferenceFunctionName(String name)
boolean
dispatch(Polyad polyad, State state)
Does the actual evaluation of thePolyad
.protected void
doFunctionEvaluation(Polyad polyad, State state, FR_WithState frs)
protected void
doIsFunction(Polyad polyad, State state)
protected void
doJavaFunction(Polyad polyad, State state, FR_WithState frs)
boolean
evaluate(String alias, Polyad polyad, State state)
boolean
evaluate(Polyad polyad, State state)
Decides if aPolyad
is evaluated by this evaluator and if not, returns false, if so, it evaluates it and returns true.protected void
figureOutEvaluation(Polyad polyad, State state, boolean checkForDuplicates)
String[]
getFunctionNames()
String
getNamespace()
int
getType(String name)
protected boolean
isFDef(Statement statement)
protected boolean
isFunctionReference(String name)
protected ArrayList<XThing>
resolveArguments(FunctionRecordInterface functionRecord, Polyad polyad, State state, State localState)
This will take the function record and polyad and find the arguments that are requested in the function record vs.protected boolean
tryScript(Polyad polyad, State state)
-
Methods inherited from class org.qdl_lang.evaluate.AbstractEvaluator
areAllBigDecimals, areAllBoolean, areAllLongs, areAllNumbers, areAllSets, areAllStems, areAllStrings, areAnyBigDecimals, areNoneStems, bdEquals, checkNull, checkNull, convertArgsToStem, 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
-
serialVersionUID
public static long serialVersionUID
-
FUNCTION_NAMESPACE
public static final String FUNCTION_NAMESPACE
- See Also:
- Constant Field Values
-
BASE_FUNCTION_VALUE
public static final int BASE_FUNCTION_VALUE
- See Also:
- Constant Field Values
-
IS_FUNCTION
public static final String IS_FUNCTION
- See Also:
- Constant Field Values
-
IS_FUNCTION_TYPE
public static final int IS_FUNCTION_TYPE
- See Also:
- Constant Field Values
-
APPLY
public static final String APPLY
- See Also:
- Constant Field Values
-
APPLY_TYPE
public static final int APPLY_TYPE
- See Also:
- Constant Field Values
-
NAMES
public static final String NAMES
- See Also:
- Constant Field Values
-
NAMES_TYPE
public static final int NAMES_TYPE
- See Also:
- Constant Field Values
-
ARG_COUNT
public static final String ARG_COUNT
- See Also:
- Constant Field Values
-
ARG_COUNT_TYPE
public static final int ARG_COUNT_TYPE
- See Also:
- Constant Field Values
-
DUMMY_BUILT_IN_FUNCTION_NAME_CAPUT
public static final String DUMMY_BUILT_IN_FUNCTION_NAME_CAPUT
- See Also:
- Constant Field Values
-
-
Method Detail
-
getNamespace
public String getNamespace()
-
getType
public int getType(String name)
-
getFunctionNames
public String[] getFunctionNames()
- Specified by:
getFunctionNames
in classAbstractEvaluator
-
evaluate
public boolean evaluate(String alias, Polyad polyad, State state)
- Overrides:
evaluate
in classAbstractEvaluator
-
evaluate
public boolean evaluate(Polyad polyad, State state)
Description copied from class:AbstractEvaluator
Decides if aPolyad
is evaluated by this evaluator and if not, returns false, if so, it evaluates it and returns true. This function actually just dispatches it toAbstractEvaluator.dispatch(Polyad, State)
where the work is done and manages putting better trace information in if there is a failure.- Overrides:
evaluate
in classAbstractEvaluator
- Returns:
-
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:
-
isFDef
protected boolean isFDef(Statement statement)
-
doJavaFunction
protected void doJavaFunction(Polyad polyad, State state, FR_WithState frs) throws Throwable
- Throws:
Throwable
-
figureOutEvaluation
protected void figureOutEvaluation(Polyad polyad, State state, boolean checkForDuplicates) throws Throwable
- Throws:
Throwable
-
doFunctionEvaluation
protected void doFunctionEvaluation(Polyad polyad, State state, FR_WithState frs) throws Throwable
- Throws:
Throwable
-
resolveArguments
protected ArrayList<XThing> resolveArguments(FunctionRecordInterface functionRecord, Polyad polyad, State state, State localState)
This will take the function record and polyad and find the arguments that are requested in the function record vs. what's in the polyad and stash them in the correct state objects.- Parameters:
functionRecord
-polyad
-state
-localState
-
-
isFunctionReference
protected boolean isFunctionReference(String name)
-
-