agg.parser
Interface Parser

All Known Implementing Classes:
AbstractParser, ExcludeParser, LayeredExcludeParser, LayeredSimpleExcludeParser, LayeredSimpleParser, SimpleExcludeParser, SimpleParser

public interface Parser

This parser eats graphs which are created by AGG. A parser needs a host graph and a stop graph. The graph grammar for parsing must contain reducing rules.

See Also:
createParser(...)

Method Summary
 void addParserEventListener(ParserEventListener l)
          Register a ParserEventListener.
 Graph getGraph()
          Returns the host graph from the parser.
 Graph getHostGraph()
          Returns the host graph from the parser.
 Graph getStopGraph()
          Returns the current stop graph of the parser.
 boolean parse()
          Starts the parser.
 void removeParserEventListener(ParserEventListener l)
          Removes a ParserEventListener.
 void setCriticalPairs(PairContainer pairs)
          Sets the critical pairs for the parser.
 void setDelayAfterApplyRule(int miliseconds)
           
 void setGrammar(GraGra grammar)
          Sets the grammar for the parser.
 void setHostGraph(Graph hostGraph)
          Sets the host graph for the parser.
 void setStopGraph(Graph stopGraph)
          Sets the stop graph for the parser.
 

Method Detail

setHostGraph

void setHostGraph(Graph hostGraph)
Sets the host graph for the parser.

Parameters:
hostGraph - The host graph.

setStopGraph

void setStopGraph(Graph stopGraph)
Sets the stop graph for the parser.

Parameters:
stopGraph - The stop graph.

setCriticalPairs

void setCriticalPairs(PairContainer pairs)
Sets the critical pairs for the parser.

Parameters:
pairs - The critical pairs are holded in a container.

setGrammar

void setGrammar(GraGra grammar)
Sets the grammar for the parser. This grammar must contain reducing rules.

Parameters:
grammar - The grammar for the parser.

getHostGraph

Graph getHostGraph()
Returns the host graph from the parser. This method is important to get the current state of parsing process.

Returns:
The current host graph.

getStopGraph

Graph getStopGraph()
Returns the current stop graph of the parser.

Returns:
The stop graph.

parse

boolean parse()
Starts the parser. The result is true if the parser can parse the graph

Returns:
true if the graph can be parsed.

getGraph

Graph getGraph()
Returns the host graph from the parser. This method is important to get the current state of parsing process.

Returns:
The current host graph.

addParserEventListener

void addParserEventListener(ParserEventListener l)
Register a ParserEventListener.

Parameters:
l - The listener

removeParserEventListener

void removeParserEventListener(ParserEventListener l)
Removes a ParserEventListener.

Parameters:
l - The listener.

setDelayAfterApplyRule

void setDelayAfterApplyRule(int miliseconds)