Pep 0.4 API Documentation

edu.osu.ling.pep
Interface ParserListener

All Superinterfaces:
EventListener
All Known Implementing Classes:
Pep

public interface ParserListener
extends EventListener

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.

Version:
$LastChangedRevision: 1799 $
Author:
Scott Martin
See Also:
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

edgeCompleted

void edgeCompleted(EdgeEvent edgeEvent)
Notifies a listener that an edge was added to the chart based on completion.

Parameters:
edgeEvent - An event containing the added edge.

edgePredicted

void edgePredicted(EdgeEvent edgeEvent)
Signals to a listener that an edge was added to the chart based on a prediction from the grammar.

Parameters:
edgeEvent - An event containing the added edge.

edgeScanned

void edgeScanned(EdgeEvent edgeEvent)
Lets the listener know that a token was scanned from the input string.

Parameters:
edgeEvent - An event containing the edge created on the basis of scanning a token.

optionSet

void optionSet(ParserOptionEvent optionEvent)
Lets the listener know that an option was set on an Earley parser.

Parameters:
optionEvent - The event containing the newly set option and its value.

parseComplete

void parseComplete(ParseEvent parseEvent)
Called when parsing completes.

Parameters:
parseEvent - An event containing the completed parse.

parseError

void parseError(ParseErrorEvent parseErrorEvent)
                throws PepException
Notifies a listener that an error occurred during parsing.

Parameters:
parseErrorEvent - An error event containing the parse that was in progress and the error that occurred.
Throws:
PepException - If the listener does not wish to handle the exception, it can re-throw the cause of the parse error event.

parseMessage

void parseMessage(ParseEvent parseEvent,
                  String message)
Notifies the listener of a message from the parser.

Parameters:
parseEvent - A parse event containing the parse in progress.
message - The message.

parserSeeded

void parserSeeded(EdgeEvent edgeEvent)
Notifies a listener that the parser was seeded with a start category.

Parameters:
edgeEvent - An event containing the added edge.

Pep: Pep is an Earley parser

Pep API Documentation, Copyright © 2007 Scott Martin

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.