-
- All Implemented Interfaces:
-
java.io.Serializable,java.lang.Cloneable
public interface IExpression implements Serializable, Cloneable
-
-
Method Summary
Modifier and Type Method Description abstract ITreeNode<out Object>calculate(Map<HashString, ITreeNode<out Object>> map)abstract ITreegetAST()abstract ITreeNode<out Object>getLeftChildren()abstract ITreeNode<out Object>getRightChildren()abstract ITreeNode<out Object>getRootNode()abstract ObjectgetRootNodeData()abstract TypegetRootNodeType()abstract booleanmatches(IExpression expr, Map<HashString, ITreeNode<out Object>> map)Tries to match this expression with expr. abstract booleanmayMatch(IExpression expr)This match method test whether or not two expressions might match. abstract booleansyntacticMatch(IExpression e)Runs a syntactic match against the e. abstract ITreeupdateMatchedVar(Map<HashString, ITreeNode<out Object>> map)-
-
Method Detail
-
calculate
abstract ITreeNode<out Object> calculate(Map<HashString, ITreeNode<out Object>> map)
- Parameters:
map- the map of the matches.
-
getLeftChildren
abstract ITreeNode<out Object> getLeftChildren()
-
getRightChildren
abstract ITreeNode<out Object> getRightChildren()
-
getRootNode
abstract ITreeNode<out Object> getRootNode()
-
getRootNodeData
abstract Object getRootNodeData()
-
getRootNodeType
abstract Type getRootNodeType()
-
matches
abstract boolean matches(IExpression expr, Map<HashString, ITreeNode<out Object>> map)
Tries to match this expression with expr. The matching rules are: (i) a variable matches everything; (ii) a constant value matches an identical constant value; (iii) a number matches an identical number or an operator, (iv) operators match everything but constants, (v) comparators match numbers and operators (verifying the values); (vi) expr type can't be comparator; (vii) add and rem operators work only with lists.
- Parameters:
expr- the expression to matchmap- the matches map
-
mayMatch
abstract boolean mayMatch(IExpression expr)
This match method test whether or not two expressions might match. It can be used to evaluate dependencies in a general fashion, it does not check if all the relations are satisfied (e.g. if applying the comparators) but makes a sort of "type checking". If you want to compare two templates, this is the way to go.
- Parameters:
expr- the expression to verify the possibility of future matches
-
syntacticMatch
abstract boolean syntacticMatch(IExpression e)
Runs a syntactic match against the e.
- Parameters:
e- the expression to match with
-
updateMatchedVar
abstract ITree updateMatchedVar(Map<HashString, ITreeNode<out Object>> map)
- Parameters:
map- the matches map
-
-
-
-