org.parboiled
Interface Rule

All Known Subinterfaces:
Matcher
All Known Implementing Classes:
AbstractMatcher, ActionMatcher, AnyMatcher, AnyOfMatcher, CharIgnoreCaseMatcher, CharMatcher, CharRangeMatcher, CustomMatcher, EmptyMatcher, FirstOfMatcher, FirstOfStringsMatcher, MemoMismatchesMatcher, NothingMatcher, OneOrMoreMatcher, OptionalMatcher, ProxyMatcher, SequenceMatcher, StringMatcher, TestMatcher, TestNotMatcher, VarFramingMatcher, ZeroOrMoreMatcher

public interface Rule

Describes the return values of parser rule production methods.


Method Summary
 Rule 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.
 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.
 

Method Detail

label

Rule label(java.lang.String label)
Attaches a label to this Rule. Corresponds to the @Label annotation.

Parameters:
label - the label
Returns:
this Rule

suppressNode

Rule suppressNode()
Instructs parboiled to not create a parse tree node for this rule and all subrules, which can significantly increase parsing performance. Corresponds to the @SuppressNode annotation.

Returns:
this Rule

suppressSubnodes

Rule suppressSubnodes()
Instructs parboiled to not create parse tree nodes for the subrules of this rule, which can significantly increase parsing performance. Corresponds to the @SuppressSubnodes annotation.

Returns:
this Rule

skipNode

Rule skipNode()
Instructs parboiled to not create a parse tree node for this rule. The parse tree nodes of all subrules are directly attached to the parent of this rule (or more correctly: the first ancestor not having been marked skipNode(). Note that, even though a rule marked as skipNode() does not create a parse tree node of its own and is therefore "invisible" in the parse tree, the rule still exists as a regular rule in the rule tree and is accompanied by a "regular" rule Context during rule matching. Corresponds to the @SkipNode annotation.

Returns:
this Rule

memoMismatches

Rule memoMismatches()
Enables memoization of rule mismatches for consecutive rule applications at the same input location.

Returns:
this rule