org.erights.e.elang.evm
Class Pattern
java.lang.Object
|
+--org.erights.e.elang.evm.ParseNode
|
+--org.erights.e.elang.evm.ENode
|
+--org.erights.e.elang.evm.Pattern
- All Implemented Interfaces:
- Cloneable, EPrintable, MatchMaker
- Direct Known Subclasses:
- CdrPattern, IgnorePattern, ListPattern, NounPattern, QuasiLiteralPatt, QuasiPatternPatt, SuchThatPattern
- public abstract class Pattern
- extends ENode
Untamed: A Pattern 1) "evaluates" in a scope, 2) matches some specimen
object, 3) binding names in this scope to values derived (usually
extracted) from the specimen, and 4) returns whether the match was
successful.
- Author:
- Mark S. Miller
Fields inherited from class org.erights.e.elang.evm.ENode |
|
Methods inherited from class org.erights.e.elang.evm.ENode |
cleanCopy, computeStaticScope, copy, getOptPatternMap, getOptScopeMap, getPatternMap, getScopeMap, qbuild, setPatternMap, setScopeMap, staticScope, synEnv, welcome |
Methods inherited from class org.erights.e.elang.evm.ParseNode |
asText, getOptSpan, lnPrintOn, lnPrintOn, matchBind, matchBind, matchBind, matchBind, printListOn, subPrintOn, toString |
Pattern
Pattern(SourceSpan optSpan)
__printOn
public void __printOn(TextWriter out)
throws IOException
- Enabled: @see #subPrintOn
- Specified by:
__printOn
in interface EPrintable
- Overrides:
__printOn
in class ParseNode
IOException
- See Also:
ParseNode.subPrintOn(org.erights.e.elib.oldeio.TextWriter, int)
substitute
public Pattern substitute(ConstList args)
- Enabled:
testMatch
abstract void testMatch(EvalContext ctx,
Object specimen,
OneArgFunc optEjector)
- If this pattern matches the specimen, add macthing bindings to the
scope.
Otherwise report the reason why not according to optEjector.
optName
public abstract String optName()
- Enabled: If this pattern is the binding occurence of a name, and it would bind
the name to a coercion of the specimen as a whole, return the name.
Else return null. The purpose is to support the extraction of fully
qualified names for object-definition expressions
comments?