public class PatternMatcherAndEvaluator extends PatternMatcher implements java.io.Externalizable
PatternMatcher.OrderlessMatcher, PatternMatcher.StackMatcher
fPatternCondition, fPatternMap, fPriority
fLhsPatternExpr
Constructor and Description |
---|
PatternMatcherAndEvaluator()
Public constructor for serialization.
|
PatternMatcherAndEvaluator(IExpr leftHandSide,
IExpr rightHandSide)
Define a pattern-matching rule.
|
PatternMatcherAndEvaluator(ISymbol.RuleType setSymbol,
IExpr leftHandSide,
IExpr rightHandSide)
ine a pattern-matching rule.
|
Modifier and Type | Method and Description |
---|---|
boolean |
checkRHSCondition(EvalEngine engine)
Check if the condition for the right-hand-sides
Module[] or Condition[] expressions evaluates to
true . |
java.lang.Object |
clone() |
boolean |
equals(java.lang.Object obj) |
int |
equivalent(IPatternMatcher obj) |
IExpr |
eval(IExpr leftHandSide)
Match the given left-hand-side and return an evaluated expression
|
IAST |
getAsAST() |
IExpr |
getRHS()
Get the "right-hand-side" of a pattern-matching rule.
|
ISymbol |
getSetSymbol()
Return
Set or SetDelayed symbol. |
int |
hashCode() |
void |
readExternal(java.io.ObjectInput objectInput) |
java.lang.String |
toString() |
void |
writeExternal(java.io.ObjectOutput objectOutput) |
checkCondition, compareTo, equivalent, evalAST, evalLeftHandSide, evalLeftHandSide, getCondition, getPatterns, getPatternValue0, getPriority, init, isRuleWithoutPatterns, logConditionFalse, matchAST, matchExpr, matchExpr, setCondition, test
getLHS
public PatternMatcherAndEvaluator()
public PatternMatcherAndEvaluator(IExpr leftHandSide, IExpr rightHandSide)
leftHandSide
- could contain pattern expressions for "pattern-matching"rightHandSide
- the result which should be evaluated if the "pattern-matching"
succeedspublic PatternMatcherAndEvaluator(ISymbol.RuleType setSymbol, IExpr leftHandSide, IExpr rightHandSide)
setSymbol
- the symbol which defines this pattern-matching rule (i.e. Set,
SetDelayed,...)leftHandSide
- could contain pattern expressions for "pattern-matching"rightHandSide
- the result which should be evaluated if the "pattern-matching"
succeedspublic java.lang.Object clone() throws java.lang.CloneNotSupportedException
clone
in class PatternMatcher
java.lang.CloneNotSupportedException
public boolean equals(java.lang.Object obj)
equals
in class PatternMatcher
public int hashCode()
hashCode
in class PatternMatcher
public boolean checkRHSCondition(EvalEngine engine)
Module[] or Condition[]
expressions evaluates to
true
.checkRHSCondition
in class PatternMatcher
true
if the right-hand-sides condition is fulfilled.checkRHSCondition(EvalEngine)
public IExpr eval(IExpr leftHandSide)
eval
in class PatternMatcher
leftHandSide
- left-hand-side expressionF.NIL
if the match wasn't successful, the evaluated
expression otherwise.public IExpr getRHS()
IPatternMatcher
getRHS
in class IPatternMatcher
F.NIL
if no right-hand-side is defined for the
pattern matcherpublic IAST getAsAST()
public ISymbol getSetSymbol()
Set
or SetDelayed
symbol.null
if no symbol was definedpublic int equivalent(IPatternMatcher obj)
equivalent
in class PatternMatcher
public java.lang.String toString()
toString
in class java.lang.Object
public void writeExternal(java.io.ObjectOutput objectOutput) throws java.io.IOException
writeExternal
in interface java.io.Externalizable
writeExternal
in class PatternMatcher
java.io.IOException
public void readExternal(java.io.ObjectInput objectInput) throws java.io.IOException, java.lang.ClassNotFoundException
readExternal
in interface java.io.Externalizable
readExternal
in class PatternMatcher
java.io.IOException
java.lang.ClassNotFoundException