public final class ParseState
extends java.lang.Object
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 . |
Modifier and Type | Field and Description |
---|---|
private java.util.Stack |
state
Internal <code>Stack</code> storage.
|
private static char |
TAB
Tab character used when rendering the tree-style representation.
|
Modifier | Constructor and Description |
---|---|
|
ParseState()
Create a new
ParseState with an empty <code>Stack</code>. |
private |
ParseState(ParseState other)
Create a new
ParseState whose <code>Stack</code> is a clone
of that of the passed in ParseState . |
Modifier and Type | Method and Description |
---|---|
ParseState.Entry |
peek()
Return the
ParseState.Entry currently at the top of the <code>Stack</code> or
null if the <code>Stack</code> is empty. |
void |
pop()
Remove an
ParseState.Entry from the <code>Stack</code>. |
void |
push(ParseState.Entry entry)
Add a new
ParseState.Entry to the <code>Stack</code>. |
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 . |
private static final char TAB
private final java.util.Stack state
public ParseState()
ParseState
with an empty <code>Stack</code>.private ParseState(ParseState other)
ParseState
whose <code>Stack</code> is a clone
of that of the passed in ParseState
.public void push(ParseState.Entry entry)
ParseState.Entry
to the <code>Stack</code>.public void pop()
ParseState.Entry
from the <code>Stack</code>.public ParseState.Entry peek()
ParseState.Entry
currently at the top of the <code>Stack</code> or
null
if the <code>Stack</code> is empty.public ParseState snapshot()
ParseState
which is an independent snapshot
of this instance.public java.lang.String toString()
ParseState
.toString
in class java.lang.Object