public class ExpressionConceptFunctionParseTreeEvaluator extends ParseTreeEvaluator
ASTPtRootNode| Red (cshelton) |
| Green (cshelton) |
| Modifier and Type | Field and Description |
|---|---|
protected java.util.List<Ontology> |
_scopeOntologies
The list of ontologies that specify the domain for each input
argument to the concept function defined by the parsed
expression.
|
_evaluatedChildToken, _typeInference| Constructor and Description |
|---|
ExpressionConceptFunctionParseTreeEvaluator(java.util.List<java.lang.String> argumentNames,
java.util.List<Concept> inputConceptValues,
OntologySolverModel solverModel,
java.util.List<Ontology> argumentDomainOntologies,
Ontology outputRangeOntology)
Construct an ExpressionConceptFunctionParseTreeEvaluator for
evaluating expressions that represent concept functions.
|
ExpressionConceptFunctionParseTreeEvaluator(java.util.Map<java.lang.String,Concept> arguments,
OntologySolverModel solverModel,
java.util.List<Ontology> domainOntologies,
Ontology outputRangeOntology)
Construct an ExpressionConceptFunctionParseTreeEvaluator for
evaluating expressions that represent concept functions.
|
| Modifier and Type | Method and Description |
|---|---|
protected Concept |
_getNamedConcept(java.lang.String conceptString)
Return the concept with the specified string representation.
|
protected java.lang.String |
_getNodeLabel(ASTPtLeafNode node)
Return the label for the leaf node.
|
ConceptToken |
evaluateParseTree(ASTPtRootNode node)
Evaluate the parse tree for the expression concept function with the
specified root node.
|
ConceptToken |
evaluateParseTree(ASTPtRootNode node,
ParserScope scope)
Evaluate the parse tree for the expression concept function with the
specified root node using the specified scope to resolve the values of
variables.
|
void |
visitFunctionApplicationNode(ASTPtFunctionApplicationNode node)
Evaluate a concept function contained in a concept function
expression.
|
void |
visitLeafNode(ASTPtLeafNode node)
Evaluate each leaf node in the parse tree to a concept
string.
|
_assert, _evaluateAllChildren, _evaluateArrayIndex, _evaluateChild, _evaluateMatrixIndex, _functionCall, _methodCall, _trace, _traceEnter, _traceLeave, traceParseTreeEvaluation, visitArrayConstructNode, visitBitwiseNode, visitFunctionalIfNode, visitFunctionDefinitionNode, visitLogicalNode, visitMatrixConstructNode, visitMethodCallNode, visitPowerNode, visitProductNode, visitRecordConstructNode, visitRelationalNode, visitShiftNode, visitSumNode, visitUnaryNode, visitUnionConstructNode_unsupportedVisitException, _visitAllChildren, _visitChild, visitAssignmentNodeprotected java.util.List<Ontology> _scopeOntologies
public ExpressionConceptFunctionParseTreeEvaluator(java.util.List<java.lang.String> argumentNames,
java.util.List<Concept> inputConceptValues,
OntologySolverModel solverModel,
java.util.List<Ontology> argumentDomainOntologies,
Ontology outputRangeOntology)
throws IllegalActionException
argumentNames - The array of argument names used in the
concept function expression.inputConceptValues - The array of concept values to which the
arguments are set.solverModel - The ontology solver model that contains the scope
of other concept functions that can be called in the expression.argumentDomainOntologies - The array of ontologies that
represent the concept domain for each input concept argument.outputRangeOntology - The ontology that represents the concept
range for the concept function.IllegalActionException - If there is a problem instantiating
the parse tree evaluator object.public ExpressionConceptFunctionParseTreeEvaluator(java.util.Map<java.lang.String,Concept> arguments, OntologySolverModel solverModel, java.util.List<Ontology> domainOntologies, Ontology outputRangeOntology) throws IllegalActionException
arguments - A map of argument names to concept values.solverModel - The ontology solver model that contains the scope
of other concept functions that can be called in the expression.domainOntologies - Ontologies over which the parser is defined.outputRangeOntology - The ontology that represents the concept
range for the concept function.IllegalActionException - If there is a problem instantiating
the parse tree evaluator object.public ConceptToken evaluateParseTree(ASTPtRootNode node) throws IllegalActionException
evaluateParseTree in class ParseTreeEvaluatornode - The root of the parse tree.IllegalActionException - If an evaluation error occurs.public ConceptToken evaluateParseTree(ASTPtRootNode node, ParserScope scope) throws IllegalActionException
evaluateParseTree in class ParseTreeEvaluatornode - The root of the parse tree.scope - The scope for evaluation.IllegalActionException - If an error occurs during
evaluation or if the result is not a ConceptToken or an ObjectToken
containing a Concept.public void visitFunctionApplicationNode(ASTPtFunctionApplicationNode node) throws IllegalActionException
visitFunctionApplicationNode in interface ParseTreeVisitorvisitFunctionApplicationNode in class ParseTreeEvaluatornode - The function expression node to be evaluated.IllegalActionException - If the function cannot be
parsed correctly.public void visitLeafNode(ASTPtLeafNode node) throws IllegalActionException
visitLeafNode in interface ParseTreeVisitorvisitLeafNode in class ParseTreeEvaluatornode - The leaf node to be visited.IllegalActionException - If the node label cannot be
resolved to a concept.protected Concept _getNamedConcept(java.lang.String conceptString) throws IllegalActionException
conceptString - The specified string the concept should have.IllegalActionException - If the concept cannot be found.protected java.lang.String _getNodeLabel(ASTPtLeafNode node)
node - The given leaf node