org.parboiled.matchers
Class ActionMatcher

java.lang.Object
  extended by org.parboiled.trees.ImmutableGraphNode<Matcher>
      extended by org.parboiled.matchers.AbstractMatcher
          extended by org.parboiled.matchers.ActionMatcher
All Implemented Interfaces:
java.lang.Cloneable, Matcher, Rule, GraphNode<Matcher>

public class ActionMatcher
extends AbstractMatcher

A Matcher that not actually matches input but runs a given parser Action.


Field Summary
 Action action
           
 java.util.List<ContextAware> contextAwares
           
 boolean skipInPredicates
           
 
Constructor Summary
ActionMatcher(Action action)
           
 
Method Summary
<R> R
accept(MatcherVisitor<R> visitor)
          Accepts the given matcher visitor.
 MatcherContext getSubContext(MatcherContext context)
          Creates a context for the matching of this matcher using the given parent context.
<V> boolean
match(MatcherContext<V> context)
          Tries a match on the given MatcherContext.
 Rule suppressNode()
          Instructs parboiled to not create a parse tree node for this rule and all subrules, which can significantly increase parsing performance.
 
Methods inherited from class org.parboiled.matchers.AbstractMatcher
areMismatchesMemoed, areSubnodesSuppressed, getLabel, getTag, hasCustomLabel, isNodeSkipped, isNodeSuppressed, label, memoMismatches, setTag, skipNode, 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
 

Field Detail

action

public final Action action

contextAwares

public final java.util.List<ContextAware> contextAwares

skipInPredicates

public final boolean skipInPredicates
Constructor Detail

ActionMatcher

public ActionMatcher(Action action)
Method Detail

getSubContext

public MatcherContext getSubContext(MatcherContext context)
Description copied from interface: Matcher
Creates a context for the matching of this matcher using the given parent context.

Specified by:
getSubContext in interface Matcher
Overrides:
getSubContext in class AbstractMatcher
Parameters:
context - the parent context
Returns:
the context this matcher is to be run in

match

public <V> boolean match(MatcherContext<V> context)
Description copied from interface: Matcher
Tries a match on the given MatcherContext.

Parameters:
context - the MatcherContext
Returns:
true if the match was successful

suppressNode

public Rule suppressNode()
Description copied from interface: Rule
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.

Specified by:
suppressNode in interface Rule
Overrides:
suppressNode in class AbstractMatcher
Returns:
this Rule

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