|
Pep 0.4 API Documentation | ||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface ParserListener
Listens to an Earley parser
, receiving notifications
as the parser adds edges to the chart or scans the input string. The parser
also notifies a listener whenever a parse completes or an error occurs
in a parse.
A listener can be specified for an Earley parser when the parser is created.
EarleyParser.EarleyParser(Grammar, ParserListener)
Method Summary | |
---|---|
void |
edgeCompleted(EdgeEvent edgeEvent)
Notifies a listener that an edge was added to the chart based on completion. |
void |
edgePredicted(EdgeEvent edgeEvent)
Signals to a listener that an edge was added to the chart based on a prediction from the grammar . |
void |
edgeScanned(EdgeEvent edgeEvent)
Lets the listener know that a token was scanned from the input string. |
void |
optionSet(ParserOptionEvent optionEvent)
Lets the listener know that an option was set on an Earley parser. |
void |
parseComplete(ParseEvent parseEvent)
Called when parsing completes. |
void |
parseError(ParseErrorEvent parseErrorEvent)
Notifies a listener that an error occurred during parsing. |
void |
parseMessage(ParseEvent parseEvent,
String message)
Notifies the listener of a message from the parser. |
void |
parserSeeded(EdgeEvent edgeEvent)
Notifies a listener that the parser was seeded with a start category. |
Method Detail |
---|
void edgeCompleted(EdgeEvent edgeEvent)
edgeEvent
- An event containing the added edge.void edgePredicted(EdgeEvent edgeEvent)
grammar
.
edgeEvent
- An event containing the added edge.void edgeScanned(EdgeEvent edgeEvent)
edgeEvent
- An event containing the edge created on the basis of
scanning a token.void optionSet(ParserOptionEvent optionEvent)
optionEvent
- The event containing the newly set option and its
value.void parseComplete(ParseEvent parseEvent)
parseEvent
- An event containing the completed parse
.void parseError(ParseErrorEvent parseErrorEvent) throws PepException
parseErrorEvent
- An error event containing the parse that was
in progress and the error that occurred.
PepException
- If the listener does not wish to handle the
exception, it can re-throw the cause of the parse error event.void parseMessage(ParseEvent parseEvent, String message)
parseEvent
- A parse event containing the parse in progress.message
- The message.void parserSeeded(EdgeEvent edgeEvent)
edgeEvent
- An event containing the added edge.
|
Pep: Pep is an Earley parser | ||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.3 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license is included in the overview file.