Package org.qdl_lang.expressions
Class ESN2
- java.lang.Object
-
- org.qdl_lang.expressions.ExpressionImpl
-
- org.qdl_lang.expressions.ESN2
-
- All Implemented Interfaces:
Serializable
,ExpressionNode
,ExpressionInterface
,HasResultInterface
,Statement
public class ESN2 extends ExpressionImpl
After a parser change to treat the dot as an operator, this was introduced. It mostly has replaced the olderExpressionStemNode
, but not quite everywhere yet.Created by Jeff Gaynor
on 6/12/21 at 6:42 AM- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class org.qdl_lang.expressions.ExpressionImpl
arguments, result, valence
-
Fields inherited from interface org.qdl_lang.statements.ExpressionInterface
ALL_INDICES_NODE, ALT_IF_NODE, ASSIGNMENT_NODE, AXIS_RESTRICTION_NODE, CLOSED_SLICE_NODE, COMPARISON_DYAD_NODE, CONSTANT_NODE, DYAD_NODE, DYADIC_FUNCTION_REFERENCE_NODE, EXPRESSION_STEM_NODE, EXPRESSION_STEM2_NODE, FUNCTION_REFERENCE_NODE, LAMBDA_DEFINITION_NODE, LIST_NODE, MODULE_NODE, MONAD_NODE, NILAD_NODE, OPEN_SLICE_NODE, PARENTHESIZED_NODE, PARSE_EXPRESSION_BLOCK_NODE, PARSE_STATEMENT_BLOCK_NODE, POLYAD_NODE, QDL_NULL_NODE, SELECT_NODE, SET_NODE, STEM_ENTRY_NODE, STEM_EXTRACTION_NODE, STEM_NODE, UNKNOWN_NODE, VARIABLE_NODE
-
-
Constructor Summary
Constructors Constructor Description ESN2()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
computeNullity(IndexList indexList)
Actual stem contract: Evaluates the indices from right to left and does the evaluations, Nullity refers to how many of the indices "go away" on actual evaluation.QDLValue
evaluate(State state)
protected QDLValue
get(State state)
QDLValue
getDefaultValue()
ExpressionInterface
getLeftArg()
int
getNodeType()
QDL is not strongly typed but Java is, so each node type should have a unique integer and conditionals should use that, not the instanceof operator.ExpressionInterface
getRightArg()
boolean
isDefaultValueNode()
ExpressionInterface
makeCopy()
boolean
remove(State state)
void
set(State state, QDLValue newValue)
void
setDefaultValue(QDLValue defaultValue)
void
setDefaultValueNode(boolean defaultValueNode)
void
setLeftArg(ExpressionInterface swri)
void
setRightArg(ExpressionInterface swri)
-
Methods inherited from class org.qdl_lang.expressions.ExpressionImpl
addArgument, evalArg, evalLastArg, evaluatedArgs, getAlias, getArgAt, getArgCount, getArguments, getEvaluatedArgs, getLastArg, getOperatorType, getResult, getResultType, getSourceCode, getTokenPosition, hasAlias, hasEvaluatedArgs, hasTokenPosition, isEvaluated, isSizeQuery, setAlias, setArguments, setEvaluated, setEvaluatedArgs, setOperatorType, setResult, setResult, setSizeQuery, setSourceCode, setTokenPosition, toString
-
-
-
-
Method Detail
-
isDefaultValueNode
public boolean isDefaultValueNode()
-
setDefaultValueNode
public void setDefaultValueNode(boolean defaultValueNode)
-
makeCopy
public ExpressionInterface makeCopy()
-
getLeftArg
public ExpressionInterface getLeftArg()
-
setLeftArg
public void setLeftArg(ExpressionInterface swri)
-
setRightArg
public void setRightArg(ExpressionInterface swri)
-
getRightArg
public ExpressionInterface getRightArg()
-
getDefaultValue
public QDLValue getDefaultValue()
-
setDefaultValue
public void setDefaultValue(QDLValue defaultValue)
-
computeNullity
protected void computeNullity(IndexList indexList)
Actual stem contract: Evaluates the indices from right to left and does the evaluations, Nullity refers to how many of the indices "go away" on actual evaluation. When this is done, the index set is simply indices, ready for set or get in the stem:rank(stem) + nullity(stem) == dim(stem)
for a given index. So if we havex.1.2 := 5; p := 1; q := 2;
Computingw.x.p.q |---| = dim is 3 => x.1.2 = 5 |-| + - nullity is 2, since these 2 go away = w.5 | +- rank is 1
hencerank + nullity = dim 1 + 2 = 3
- Parameters:
indexList
-
-
remove
public boolean remove(State state)
-
getNodeType
public int getNodeType()
Description copied from interface:ExpressionInterface
QDL is not strongly typed but Java is, so each node type should have a unique integer and conditionals should use that, not the instanceof operator. This allows for efficient programming with switch statements rather than a bevy of conditionals (potentially each of which gets done even if the correct case has been handled).- Returns:
-
-