Package org.parboiled.matchers
Class SequenceMatcher
- java.lang.Object
-
- org.parboiled.trees.ImmutableGraphNode<Matcher>
-
- org.parboiled.matchers.AbstractMatcher
-
- org.parboiled.matchers.SequenceMatcher
-
- Direct Known Subclasses:
StringMatcher
public class SequenceMatcher extends AbstractMatcher
AMatcherthat executes all of its submatchers in sequence and only succeeds if all submatchers succeed.
-
-
Constructor Summary
Constructors Constructor Description SequenceMatcher(Rule[] subRules)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <R> Raccept(MatcherVisitor<R> visitor)Accepts the given matcher visitor.TdefaultLabel(java.lang.String defaultLabel)java.lang.StringgetLabel()booleanhasCustomLabel()booleanmatch(MatcherContext context)Tries a match on the given MatcherContext.-
Methods inherited from class org.parboiled.matchers.AbstractMatcher
areMismatchesMemoed, areSubnodesSuppressed, getSubContext, getTag, isNodeSkipped, isNodeSuppressed, label, memoMismatches, setTag, skipNode, suppressNode, suppressSubnodes, toString
-
Methods inherited from class org.parboiled.trees.ImmutableGraphNode
getChildren
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.parboiled.trees.GraphNode
getChildren
-
-
-
-
Constructor Detail
-
SequenceMatcher
public SequenceMatcher(Rule[] subRules)
-
-
Method Detail
-
match
public boolean match(MatcherContext context)
Description copied from interface:MatcherTries a match on the given MatcherContext.- Parameters:
context- the MatcherContext- Returns:
- true if the match was successful
-
accept
public <R> R accept(MatcherVisitor<R> visitor)
Description copied from interface:MatcherAccepts the given matcher visitor.- Parameters:
visitor- the visitor- Returns:
- the value returned by the given visitor
-
getLabel
public java.lang.String getLabel()
- Specified by:
getLabelin interfaceMatcher- Overrides:
getLabelin classAbstractMatcher- Returns:
- the label of the matcher (which is identical to the label of the Rule this matcher matches)
-
hasCustomLabel
public boolean hasCustomLabel()
- Specified by:
hasCustomLabelin interfaceMatcher- Overrides:
hasCustomLabelin classAbstractMatcher- Returns:
- true if this matcher has been assigned a custom label
-
defaultLabel
public T defaultLabel(java.lang.String defaultLabel)
-
-