-
-
Method Summary
Modifier and Type Method Description ASTassignVarValue(Map<HashString, ITreeNode<out Object>> matches)This method substitutes variables present in matches map with their values. doubleevaluation(Map<HashString, ITreeNode<out Object>> matches)This evaluates the expression. ITreeNode<out Object>getRoot()Return the root Node of the tree. HashStringtoHashString()Similar to toString(), but returns a HashString. StringtoString()-
-
Method Detail
-
assignVarValue
AST assignVarValue(Map<HashString, ITreeNode<out Object>> matches)
This method substitutes variables present in matches map with their values. It must involve only node of Typ=Var. The method must also recognize the values type stored in the map (they can be Const or Num).
- Parameters:
matches- the map with variable values already assigned.
-
evaluation
double evaluation(Map<HashString, ITreeNode<out Object>> matches)
This evaluates the expression. If the matches map contains values which are not instanced, and the expression value cannot consequently be computed, 0d is returned.
- Parameters:
matches- the map that binds each variable with its own value
-
toHashString
HashString toHashString()
Similar to toString(), but returns a HashString.
-
-
-
-