Constructor and Description |
---|
Matcher()
The constructor
|
Modifier and Type | Method and Description |
---|---|
IExpr |
apply(IExpr expression)
Main method performing the pattern matching.
|
void |
caseBoole(IExpr patternMatchingRule,
java.util.function.BiPredicate<IExpr,IExpr> predicate)
If this rule matches the evaluation will return
F.True or
F.False depending on the predicates result. |
void |
caseBoole(IExpr patternMatchingRule,
java.util.function.Predicate<IExpr> predicate)
If this rule matches the evaluation will return
F.True or
F.False depending on the predicates result. |
void |
caseMethod(IExpr patternMatchingRule,
IPatternMethod method)
If this rule matches the evaluation will return the result of the
method.eval() method. |
void |
caseOf(IExpr patternMatchingRule,
java.util.function.BiFunction<IExpr,IExpr,IExpr> function)
If this rule matches the evaluation will return the result of the
function.apply() method. |
void |
caseOf(IExpr patternMatchingRule,
java.util.function.Function<IExpr,IExpr> function)
If this rule matches the evaluation will return the result of the
function.apply() method. |
void |
caseOf(IExpr patternMatchingRule,
IExpr resultExpr)
Method called in order to add a new pattern-matching rule to this
rule-set.
|
IExpr |
replaceAll(IExpr expression)
Replace all (sub-) expressions with the given rule set.
|
public void caseOf(IExpr patternMatchingRule, IExpr resultExpr)
patternMatchingRule
- the pattern-matching ruleresultExpr
- the result expression which should be returned if the
pattern-matching rule matches an expression in the apply
method.public void caseMethod(IExpr patternMatchingRule, IPatternMethod method)
method.eval()
method.patternMatchingRule
- method
- public void caseOf(IExpr patternMatchingRule, java.util.function.Function<IExpr,IExpr> function)
function.apply()
method.patternMatchingRule
- function
- public void caseOf(IExpr patternMatchingRule, java.util.function.BiFunction<IExpr,IExpr,IExpr> function)
function.apply()
method.patternMatchingRule
- function
- public void caseBoole(IExpr patternMatchingRule, java.util.function.Predicate<IExpr> predicate)
F.True
or
F.False
depending on the predicates
result.patternMatchingRule
- predicate
- public void caseBoole(IExpr patternMatchingRule, java.util.function.BiPredicate<IExpr,IExpr> predicate)
F.True
or
F.False
depending on the predicates
result.patternMatchingRule
- predicate
-