Package org.qdl_lang.expressions
Class ExpressionStemNode
- java.lang.Object
- 
- org.qdl_lang.expressions.ExpressionStemNode
 
- 
- All Implemented Interfaces:
- Serializable,- ExpressionInterface,- HasResultInterface,- Statement
 
 public class ExpressionStemNode extends Object implements ExpressionInterface Models a stem.Created by Jeff Gaynor 
 on 3/5/21 at 5:58 AM- See Also:
- Serialized Form
 
- 
- 
Field Summary- 
Fields inherited from interface org.qdl_lang.statements.ExpressionInterfaceALL_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 SummaryConstructors Constructor Description ExpressionStemNode()
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description protected ObjectdoLeftSVCase(ExpressionInterface leftArg, List<ExpressionInterface> indices, State state)Case that the left hand argument is a stem variable.protected ObjectdoLeftSVCase(ExpressionInterface leftArg, ExpressionInterface rightArg, State state)QDLValueevaluate(State state)Since this is a dyadic operation in the parser, the result will be a tree of objects of the formStringgetAlias()ArrayList<ExpressionInterface>getArguments()ExpressionInterfacegetLeftArg()intgetNodeType()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.protected QDLValuegetOrSetValue(State state, boolean setValue, QDLValue newValue)QDLValuegetResult()intgetResultType()ExpressionInterfacegetRightArg()List<String>getSourceCode()TokenPositiongetTokenPosition()booleanhasAlias()booleanhasTokenPosition()booleanisEvaluated()ExpressionInterfacemakeCopy()voidsetAlias(String alias)voidsetArguments(ArrayList<ExpressionInterface> arguments)voidsetEvaluated(boolean evaluated)voidsetLeftArg(ExpressionInterface swri)voidsetResult(Object result)Convenience method.This should turn the object into a properQDLValueas needed.voidsetResult(QDLValue object)voidsetRightArg(ExpressionInterface swri)voidsetSourceCode(List<String> sourceCode)voidsetTokenPosition(TokenPosition tokenPosition)Set the location of this token from the parser.QDLValuesetValue(State state, QDLValue newValue)
 
- 
- 
- 
Method Detail- 
setTokenPositionpublic void setTokenPosition(TokenPosition tokenPosition) Description copied from interface:StatementSet the location of this token from the parser. This is used for error notifications later.- Specified by:
- setTokenPositionin interface- Statement
 
 - 
getTokenPositionpublic TokenPosition getTokenPosition() - Specified by:
- getTokenPositionin interface- Statement
 
 - 
hasTokenPositionpublic boolean hasTokenPosition() - Specified by:
- hasTokenPositionin interface- Statement
 
 - 
hasAliaspublic boolean hasAlias() - Specified by:
- hasAliasin interface- ExpressionInterface
 
 - 
getAliaspublic String getAlias() - Specified by:
- getAliasin interface- ExpressionInterface
 
 - 
setAliaspublic void setAlias(String alias) - Specified by:
- setAliasin interface- ExpressionInterface
 
 - 
getArgumentspublic ArrayList<ExpressionInterface> getArguments() 
 - 
setArgumentspublic void setArguments(ArrayList<ExpressionInterface> arguments) 
 - 
getResultpublic QDLValue getResult() - Specified by:
- getResultin interface- HasResultInterface
 
 - 
setResultpublic void setResult(QDLValue object) - Specified by:
- setResultin interface- HasResultInterface
 
 - 
setResultpublic void setResult(Object result) Description copied from interface:HasResultInterfaceConvenience method.This should turn the object into a properQDLValueas needed.- Specified by:
- setResultin interface- HasResultInterface
 
 - 
getResultTypepublic int getResultType() - Specified by:
- getResultTypein interface- HasResultInterface
 
 - 
isEvaluatedpublic boolean isEvaluated() - Specified by:
- isEvaluatedin interface- HasResultInterface
 
 - 
setEvaluatedpublic void setEvaluated(boolean evaluated) - Specified by:
- setEvaluatedin interface- HasResultInterface
 
 - 
getLeftArgpublic ExpressionInterface getLeftArg() 
 - 
setLeftArgpublic void setLeftArg(ExpressionInterface swri) 
 - 
setRightArgpublic void setRightArg(ExpressionInterface swri) 
 - 
getRightArgpublic ExpressionInterface getRightArg() 
 - 
evaluatepublic QDLValue evaluate(State state) Since this is a dyadic operation in the parser, the result will be a tree of objects of the formx / \ ... scalar x / \ A B
 - 
doLeftSVCaseprotected Object doLeftSVCase(ExpressionInterface leftArg, ExpressionInterface rightArg, State state) 
 - 
doLeftSVCaseprotected Object doLeftSVCase(ExpressionInterface leftArg, List<ExpressionInterface> indices, State state) Case that the left hand argument is a stem variable. This does the lookup. In the variable case, aStemMultiIndexis created and interacts with theStateto do the resolutions.- Parameters:
- leftArg-
- state-
- Returns:
 
 - 
getSourceCodepublic List<String> getSourceCode() - Specified by:
- getSourceCodein interface- Statement
 
 - 
setSourceCodepublic void setSourceCode(List<String> sourceCode) - Specified by:
- setSourceCodein interface- Statement
 
 - 
makeCopypublic ExpressionInterface makeCopy() - Specified by:
- makeCopyin interface- ExpressionInterface
 
 - 
getNodeTypepublic int getNodeType() Description copied from interface:ExpressionInterfaceQDL 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).- Specified by:
- getNodeTypein interface- ExpressionInterface
- Returns:
 
 
- 
 
-