|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.parboiled.support.MatcherPath
public class MatcherPath
Holds a snapshot of the current Matcher
stack at a certain point during the parsing process.
Implemented as a specialized, immutable single-linked list of Element objects with the deepest stack Element
in the first position and the root at the end.
Nested Class Summary | |
---|---|
static class |
MatcherPath.Element
|
Field Summary | |
---|---|
MatcherPath.Element |
element
|
MatcherPath |
parent
|
Constructor Summary | |
---|---|
MatcherPath(MatcherPath.Element element,
MatcherPath parent)
Constructs a new MatcherPath wrapping the given elements. |
Method Summary | |
---|---|
MatcherPath |
commonPrefix(MatcherPath that)
Returns the common prefix of this MatcherPath and the given other one. |
boolean |
contains(Matcher matcher)
Determines whether the given matcher is contained in this path. |
MatcherPath.Element |
getElementAtLevel(int level)
Returns the Element at the given level. |
boolean |
isPrefixOf(MatcherPath that)
Determines whether this path is a prefix of the given other path. |
int |
length()
|
java.lang.String |
toString()
|
java.lang.String |
toString(MatcherPath skipPrefix)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public final MatcherPath.Element element
public final MatcherPath parent
Constructor Detail |
---|
public MatcherPath(MatcherPath.Element element, MatcherPath parent)
Context.getPath()
to
get one.
element
- the last element of this pathparent
- the parent pathMethod Detail |
---|
public int length()
public boolean isPrefixOf(MatcherPath that)
that
- the other path
public MatcherPath.Element getElementAtLevel(int level)
level
- the level to get the element from
public MatcherPath commonPrefix(MatcherPath that)
that
- the other path
public boolean contains(Matcher matcher)
matcher
- the matcher
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String toString(MatcherPath skipPrefix)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |