org.parboiled.matchervisitors
Class FollowMatchersVisitor

java.lang.Object
  extended by org.parboiled.matchervisitors.DefaultMatcherVisitor<java.lang.Boolean>
      extended by org.parboiled.matchervisitors.FollowMatchersVisitor
All Implemented Interfaces:
MatcherVisitor<java.lang.Boolean>

public class FollowMatchersVisitor
extends DefaultMatcherVisitor<java.lang.Boolean>

Collects the matchers that can legally follow the currently running matcher according to the grammar into a given list. The visitor returns true if the collected matchers are all possible followers, and false if other matchers higher up the rule stack can also follow.


Constructor Summary
FollowMatchersVisitor()
           
 
Method Summary
 java.lang.Boolean defaultValue(AbstractMatcher matcher)
          Returns the default value for all visiting methods that have not been overridden.
 java.util.List<Matcher> getFollowMatchers(MatcherContext currentContext)
           
 java.lang.Boolean visit(OneOrMoreMatcher matcher)
           
 java.lang.Boolean visit(SequenceMatcher matcher)
           
 java.lang.Boolean visit(ZeroOrMoreMatcher matcher)
           
 
Methods inherited from class org.parboiled.matchervisitors.DefaultMatcherVisitor
visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FollowMatchersVisitor

public FollowMatchersVisitor()
Method Detail

getFollowMatchers

public java.util.List<Matcher> getFollowMatchers(MatcherContext currentContext)

visit

public java.lang.Boolean visit(OneOrMoreMatcher matcher)
Specified by:
visit in interface MatcherVisitor<java.lang.Boolean>
Overrides:
visit in class DefaultMatcherVisitor<java.lang.Boolean>

visit

public java.lang.Boolean visit(SequenceMatcher matcher)
Specified by:
visit in interface MatcherVisitor<java.lang.Boolean>
Overrides:
visit in class DefaultMatcherVisitor<java.lang.Boolean>

visit

public java.lang.Boolean visit(ZeroOrMoreMatcher matcher)
Specified by:
visit in interface MatcherVisitor<java.lang.Boolean>
Overrides:
visit in class DefaultMatcherVisitor<java.lang.Boolean>

defaultValue

public java.lang.Boolean defaultValue(AbstractMatcher matcher)
Description copied from class: DefaultMatcherVisitor
Returns the default value for all visiting methods that have not been overridden.

Overrides:
defaultValue in class DefaultMatcherVisitor<java.lang.Boolean>
Parameters:
matcher - the matcher
Returns:
the return value (null by default)