Package eu.bandm.tools.paisley
Class Pattern.Either<A>
java.lang.Object
eu.bandm.tools.paisley.Pattern<A>
eu.bandm.tools.paisley.Binary<A,A,A>
eu.bandm.tools.paisley.Pattern.Either<A>
- All Implemented Interfaces:
Serializable,Cloneable
-
Nested Class Summary
Nested classes/interfaces inherited from class eu.bandm.tools.paisley.Pattern
Pattern.Either<A> -
Field Summary
FieldsFields inherited from class eu.bandm.tools.paisley.Pattern
_left_matched, _target_save, none -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanChecks whether a variable is bound by this pattern.protected voidcompileCut(CompilationContext context, boolean recursively) protected voidcompileMatch(CompilationContext context) protected voidcompileMatchAgain(CompilationContext context) protected voidcompileMatchNext(CompilationContext context) protected voidcompileMatchNext(CompilationContext context, boolean again) voidcut(boolean recursively) Disposes of all internal state related to nondeterminism.booleanChecks whether this pattern is deterministic.booleanAttempts to match this pattern against a given object.booleanAttempts to re-match this pattern against a previously matched object.booleanChecks whether a variable is preserved by this pattern, unconditionally.booleanChecks whether a variable is preserved by this pattern, conditionally on success or failure.protected StringMethods inherited from class eu.bandm.tools.paisley.Binary
clear, clone, compileClear, getLeft, getRight, toStringMethods inherited from class eu.bandm.tools.paisley.Pattern
all, all, all, all, all, and, andThen, andThen, any, aside, both, clear, compile, compileClear, compileCut, compileIsDeterministic, compileSubPattern, compileThis, compileUpTo, cut, DEBUG, either, enPassant, flatten, limit, main, matchOnce, matchVar, narrow, newAll, noMatch, none, of, once, or, orElse, orElse, repeat, some, some, some, some, someMatch, startCompile, uniquely, variable, variable
-
Field Details
-
target_save
A target_save -
left_matched
boolean left_matched
-
-
Constructor Details
-
Either
-
-
Method Details
-
match
Description copied from class:PatternAttempts to match this pattern against a given object. If the class of this pattern imposes a specific order on matches, the first one is chosen. -
matchAgain
public boolean matchAgain()Description copied from class:PatternAttempts to re-match this pattern against a previously matched object. If the class of this pattern imposes a specific order on matches, they are chosen in that order, beginning with the second one. The behaviour of this method is unspecified if the last matching attempt of this pattern has not been successful.Patterns classes that do not override this method are deterministic. Pattern classes that overwrite this method to provide additional matches should also override
Pattern.isDeterministic().- Overrides:
matchAgainin classPattern<A>- Returns:
trueif the matching is successful,falseif it fails. WhichVariables are bound by a successful match depends. The default implementation always returnsfalse.- See Also:
-
cut
public void cut(boolean recursively) Description copied from class:BinaryDisposes of all internal state related to nondeterminism.The default implementation does nothing. Subclasses that override this method should also override
Pattern.clear(boolean)and ensure that it implies the effect ofcut(false). The default implementation delegates toleftandrightifrecursivelyistrue. -
binds
Description copied from class:PatternChecks whether a variable is bound by this pattern.The default implementation returns
false. -
preserves
Description copied from class:PatternChecks whether a variable is preserved by this pattern, conditionally on success or failure.The default implementation returns
false. -
preserves
Description copied from class:PatternChecks whether a variable is preserved by this pattern, unconditionally.The default implementation returns
false. -
isDeterministic
public boolean isDeterministic()Description copied from class:PatternChecks whether this pattern is deterministic.The default implementation returns
true.- Overrides:
isDeterministicin classPattern<A>- Returns:
trueif this pattern is guaranteed to match any object at most once,falseotherwise.- See Also:
-
compileCut
- Overrides:
compileCutin classBinary<A,A, A>
-
toStringOperator
- Overrides:
toStringOperatorin classBinary<A,A, A>
-
compileMatch
- Overrides:
compileMatchin classBinary<A,A, A>
-
compileMatchNext
-
compileMatchAgain
- Overrides:
compileMatchAgainin classBinary<A,A, A>
-
compileMatchNext
-