|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectnet.percederberg.grammatica.parser.Parser
A base parser class. This class provides the standard parser interface, as well as token handling.
| Method Summary | |
void |
addPattern(ProductionPattern pattern)
Adds a new production pattern to the parser. |
Analyzer |
getAnalyzer()
Returns the analyzer in use by this parser. |
Tokenizer |
getTokenizer()
Returns the tokenizer in use by this parser. |
Node |
parse()
Parses the token stream and returns a parse tree. |
protected abstract Node |
parseStart()
Parses the token stream and returns a parse tree. |
void |
prepare()
Initializes the parser. |
java.lang.String |
toString()
Returns a string representation of this parser. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Method Detail |
public Tokenizer getTokenizer()
public Analyzer getAnalyzer()
public void addPattern(ProductionPattern pattern)
throws ParserCreationException
pattern - the pattern to add
ParserCreationException - if the pattern couldn't be
added correctly to the parser
public void prepare()
throws ParserCreationException
ParserCreationException - if the parser couldn't be
initialized correctly
public Node parse()
throws ParserCreationException,
ParserLogException
ParserCreationException - if the parser couldn't be
initialized correctly
ParserLogException - if the input couldn't be parsed
correctlyprepare()
protected abstract Node parseStart()
throws ParseException
ParseException - if the input couldn't be parsed
correctlypublic java.lang.String toString()
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||