public abstract class IPatternMatcher extends java.lang.Object implements java.util.function.Predicate<IExpr>, java.lang.Cloneable, java.lang.Comparable<IPatternMatcher>, java.io.Serializable
Modifier and Type | Field and Description |
---|---|
protected IExpr |
fLhsPatternExpr
Contains the "pattern-matching" expression
|
Modifier | Constructor and Description |
---|---|
protected |
IPatternMatcher() |
|
IPatternMatcher(IExpr lhsPatternExpr) |
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
clone() |
abstract IExpr |
eval(IExpr leftHandSide)
Match the given left-hand-side and return an evaluated expression
|
IExpr |
getLHS()
Get the "left-hand-side" of a pattern-matching rule.
|
abstract void |
getPatterns(java.util.List<IExpr> resultList,
IExpr patternExpr)
Returns the matched pattern in the order they appear in the pattern
expression.
|
abstract int |
getPriority()
Get the priority of this pattern-matcher.
|
IExpr |
getRHS()
Get the "right-hand-side" of a pattern-matching rule.
|
abstract boolean |
isRuleWithoutPatterns()
Check if the pattern-matchings left-hand-side expression contains no
patterns.
|
abstract boolean |
test(IExpr expr)
Start pattern matching.
|
protected IExpr fLhsPatternExpr
protected IPatternMatcher()
public IPatternMatcher(IExpr lhsPatternExpr)
public IExpr getLHS()
public IExpr getRHS()
F.NIL
if no right-hand-side is defined for the
pattern matcherpublic abstract void getPatterns(java.util.List<IExpr> resultList, IExpr patternExpr)
resultList
- a list instancepatternExpr
- the expression which contains the pattern objectspublic abstract int getPriority()
public abstract boolean isRuleWithoutPatterns()
true
, if the given expression contains no patternspublic abstract boolean test(IExpr expr)
test
in interface java.util.function.Predicate<IExpr>
expr
- true
if the expr
matches the
pattern-matchings left-hand-side expression.public abstract IExpr eval(IExpr leftHandSide)
leftHandSide
- left-hand-side expressionF.NIL
if the match wasn't successful, the evaluated
expression otherwise.public java.lang.Object clone() throws java.lang.CloneNotSupportedException
clone
in class java.lang.Object
java.lang.CloneNotSupportedException