Package org.parboiled.matchers
Class TestMatcher
java.lang.Object
org.parboiled.trees.ImmutableGraphNode<Matcher>
org.parboiled.matchers.AbstractMatcher
org.parboiled.matchers.TestMatcher
A special
Matcher
not actually matching any input but rather trying its submatcher against the current input
position. Succeeds if the submatcher would succeed.-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription<R> R
accept
(MatcherVisitor<R> visitor) Accepts the given matcher visitor.defaultLabel
(String defaultLabel) getLabel()
boolean
boolean
match
(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
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.parboiled.trees.GraphNode
getChildren
-
Field Details
-
subMatcher
-
-
Constructor Details
-
TestMatcher
-
-
Method Details
-
match
Description copied from interface:Matcher
Tries a match on the given MatcherContext.- Parameters:
context
- the MatcherContext- Returns:
- true if the match was successful
-
accept
Description copied from interface:Matcher
Accepts the given matcher visitor.- Parameters:
visitor
- the visitor- Returns:
- the value returned by the given visitor
-
getLabel
- Specified by:
getLabel
in interfaceMatcher
- Overrides:
getLabel
in 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:
hasCustomLabel
in interfaceMatcher
- Overrides:
hasCustomLabel
in classAbstractMatcher
- Returns:
- true if this matcher has been assigned a custom label
-
defaultLabel
-