org.parboiled.matchers
Class TestNotMatcher
java.lang.Object
org.parboiled.trees.ImmutableGraphNode<Matcher>
org.parboiled.matchers.AbstractMatcher
org.parboiled.matchers.TestNotMatcher
- All Implemented Interfaces:
- java.lang.Cloneable, Matcher, Rule, GraphNode<Matcher>
public class TestNotMatcher
- extends AbstractMatcher
A special Matcher
not actually matching any input but rather trying its submatcher against the current input
position. Succeeds if the submatcher would fail.
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 java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
subMatcher
public final Matcher subMatcher
TestNotMatcher
public TestNotMatcher(Rule subRule)
match
public boolean match(MatcherContext context)
- Description copied from interface:
Matcher
- Tries 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:
Matcher
- Accepts the given matcher visitor.
- Parameters:
visitor
- the visitor
- Returns:
- the value returned by the given visitor
getLabel
public java.lang.String getLabel()
- Specified by:
getLabel
in interface Matcher
- Overrides:
getLabel
in class AbstractMatcher
- 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 interface Matcher
- Overrides:
hasCustomLabel
in class AbstractMatcher
- Returns:
- true if this matcher has been assigned a custom label
defaultLabel
public T defaultLabel(java.lang.String defaultLabel)