Package org.parboiled.matchervisitors
Class FollowMatchersVisitor
- java.lang.Object
-
- org.parboiled.matchervisitors.DefaultMatcherVisitor<Boolean>
-
- org.parboiled.matchervisitors.FollowMatchersVisitor
-
- All Implemented Interfaces:
MatcherVisitor<Boolean>
public class FollowMatchersVisitor extends DefaultMatcherVisitor<Boolean>
Collects the matchers that can legally follow the given 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
Constructors Constructor Description FollowMatchersVisitor()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Boolean
defaultValue(AbstractMatcher matcher)
Returns the default value for all visiting methods that have not been overridden.List<Matcher>
getFollowMatchers(MatcherContext currentContext)
Boolean
visit(OneOrMoreMatcher matcher)
Boolean
visit(SequenceMatcher matcher)
Boolean
visit(ZeroOrMoreMatcher matcher)
-
-
-
Method Detail
-
getFollowMatchers
public List<Matcher> getFollowMatchers(MatcherContext currentContext)
-
visit
public Boolean visit(OneOrMoreMatcher matcher)
- Specified by:
visit
in interfaceMatcherVisitor<Boolean>
- Overrides:
visit
in classDefaultMatcherVisitor<Boolean>
-
visit
public Boolean visit(SequenceMatcher matcher)
- Specified by:
visit
in interfaceMatcherVisitor<Boolean>
- Overrides:
visit
in classDefaultMatcherVisitor<Boolean>
-
visit
public Boolean visit(ZeroOrMoreMatcher matcher)
- Specified by:
visit
in interfaceMatcherVisitor<Boolean>
- Overrides:
visit
in classDefaultMatcherVisitor<Boolean>
-
defaultValue
public 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 classDefaultMatcherVisitor<Boolean>
- Parameters:
matcher
- the matcher- Returns:
- the return value (null by default)
-
-