public abstract class AbstractMatcher extends ImmutableGraphNode<Matcher> implements Matcher, java.lang.Cloneable
Matcher
s.Modifier and Type | Field and Description |
---|---|
private java.lang.String |
label |
private boolean |
nodeSkipped |
private boolean |
nodeSuppressed |
private boolean |
subnodesSuppressed |
private java.lang.Object |
tag |
Constructor and Description |
---|
AbstractMatcher(Rule[] subRules,
java.lang.String label) |
AbstractMatcher(Rule subRule,
java.lang.String label) |
AbstractMatcher(java.lang.String label) |
Modifier and Type | Method and Description |
---|---|
boolean |
areMismatchesMemoed() |
boolean |
areSubnodesSuppressed() |
private AbstractMatcher |
createClone() |
java.lang.String |
getLabel() |
MatcherContext |
getSubContext(MatcherContext context)
Creates a context for the matching of this matcher using the given parent context.
|
java.lang.Object |
getTag()
Retrieves a previously set tag object.
|
boolean |
hasCustomLabel() |
boolean |
isNodeSkipped() |
boolean |
isNodeSuppressed() |
AbstractMatcher |
label(java.lang.String label)
Attaches a label to this Rule.
|
Rule |
memoMismatches()
Enables memoization of rule mismatches for consecutive rule applications at the same input location.
|
void |
setTag(java.lang.Object tagObject)
Associates an arbitrary object with this matcher.
|
Rule |
skipNode()
Instructs parboiled to not create a parse tree node for this rule.
|
Rule |
suppressNode()
Instructs parboiled to not create a parse tree node for this rule and all subrules,
which can significantly increase parsing performance.
|
Rule |
suppressSubnodes()
Instructs parboiled to not create parse tree nodes for the subrules of this rule,
which can significantly increase parsing performance.
|
private static Matcher[] |
toMatchers(Rule[] subRules) |
java.lang.String |
toString() |
getChildren
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getChildren
private java.lang.String label
private boolean nodeSuppressed
private boolean subnodesSuppressed
private boolean nodeSkipped
private java.lang.Object tag
public AbstractMatcher(java.lang.String label)
public AbstractMatcher(Rule subRule, java.lang.String label)
public AbstractMatcher(Rule[] subRules, java.lang.String label)
public boolean isNodeSuppressed()
isNodeSuppressed
in interface Matcher
public boolean areSubnodesSuppressed()
areSubnodesSuppressed
in interface Matcher
public boolean isNodeSkipped()
isNodeSkipped
in interface Matcher
public boolean areMismatchesMemoed()
areMismatchesMemoed
in interface Matcher
public java.lang.String getLabel()
public boolean hasCustomLabel()
hasCustomLabel
in interface Matcher
public java.lang.String toString()
toString
in class java.lang.Object
public AbstractMatcher label(java.lang.String label)
Rule
public Rule suppressNode()
Rule
suppressNode
in interface Rule
public Rule suppressSubnodes()
Rule
suppressSubnodes
in interface Rule
public Rule skipNode()
Rule
Context
during rule matching.
Corresponds to the @SkipNode annotation.public Rule memoMismatches()
Rule
memoMismatches
in interface Rule
public java.lang.Object getTag()
Matcher
public void setTag(java.lang.Object tagObject)
Matcher
public MatcherContext getSubContext(MatcherContext context)
Matcher
getSubContext
in interface Matcher
context
- the parent contextprivate AbstractMatcher createClone()