|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.avro.io.parsing.Parser
public class Parser
Parser is the class that maintains the stack for parsing. This class is used by encoders, which are not required to skip.
Nested Class Summary | |
---|---|
static interface |
Parser.ActionHandler
The parser knows how to handle the terminal and non-terminal symbols. |
Field Summary | |
---|---|
protected int |
pos
|
protected Symbol[] |
stack
|
protected Parser.ActionHandler |
symbolHandler
|
Constructor Summary | |
---|---|
Parser(Symbol root,
Parser.ActionHandler symbolHandler)
|
Method Summary | |
---|---|
Symbol |
advance(Symbol input)
Recursively replaces the symbol at the top of the stack with its production, until the top is a terminal. |
int |
depth()
Returns the depth of the stack. |
Symbol |
popSymbol()
Pops and returns the top symbol from the stack. |
void |
pushProduction(Symbol input,
Symbol sym)
Pushes the production for the given symbol sym. |
void |
pushSymbol(Symbol sym)
Pushes sym on to the stack. |
void |
reset()
|
Symbol |
topSymbol()
Returns the top symbol from the stack. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected final Parser.ActionHandler symbolHandler
protected Symbol[] stack
protected int pos
Constructor Detail |
---|
public Parser(Symbol root, Parser.ActionHandler symbolHandler) throws IOException
IOException
Method Detail |
---|
public final Symbol advance(Symbol input) throws IOException
input
- The symbol to match against the terminal at the
top of the stack.
IOException
public final void pushProduction(Symbol input, Symbol sym)
Symbol.ARRAY_END
or Symbol.MAP_END
pushes nothing.
input
- sym
- public Symbol popSymbol()
public Symbol topSymbol()
public void pushSymbol(Symbol sym)
public int depth()
public void reset()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |