public final class ParseState
extends java.lang.Object
Stack
-based structure for tracking the logical position during
a parsing process. entries
are added to the stack at
each point during the parse phase in a reader-specific manner.
Calling toString()
will render a tree-style view of the current logical
position in the parse phase. This representation is intended for use in
error messages.
Modifier and Type | Class and Description |
---|---|
static interface |
ParseState.Entry
Marker interface for entries into the
ParseState . |
Constructor and Description |
---|
ParseState()
Create a new
ParseState with an empty Stack . |
Modifier and Type | Method and Description |
---|---|
ParseState.Entry |
peek()
|
void |
pop()
Remove an
ParseState.Entry from the Stack . |
void |
push(ParseState.Entry entry)
Add a new
ParseState.Entry to the Stack . |
ParseState |
snapshot()
Create a new instance of
ParseState which is an independent snapshot
of this instance. |
java.lang.String |
toString()
Returns a tree-style representation of the current
ParseState . |
public void push(ParseState.Entry entry)
ParseState.Entry
to the Stack
.public void pop()
ParseState.Entry
from the Stack
.@Nullable public ParseState.Entry peek()
public ParseState snapshot()
ParseState
which is an independent snapshot
of this instance.public java.lang.String toString()
ParseState
.toString
in class java.lang.Object