agg.parser
Class ParserFactory

java.lang.Object
  extended by agg.parser.ParserFactory

public class ParserFactory
extends java.lang.Object

This factory produces diffrent objects. With the help of some option objects the specific object is creates. E.g. if a parser is desired the option distinguish which parser is created.


Method Summary
static PairContainer createEmptyCriticalPairs(GraGra grammar, CriticalPairOption option)
          Creates a empty container for critical pairs.
static PairContainer createEmptyCriticalPairs(GraGra grammar, int algorithm, boolean layered)
           
static PairContainer createEmptyCriticalPairs(GraGra grammar, LayerFunction layerFunc, CriticalPairOption option)
          Deprecated.  
static LayerFunction createLayerFunction(GraGra grammar, LayerOption option)
          Deprecated.  
static Parser createParser(GraGra grammar, Graph hostGraph, Graph stopGraph, PairContainer pairs, ParserOption option, LayerFunction layer)
          Deprecated.  
static Parser createParser(GraGra grammar, Graph hostGraph, Graph stopGraph, PairContainer pairs, ParserOption option, RuleLayer layer)
          Here is a new parser created.
static PairContainer generateCriticalPairs(GraGra grammar, LayerFunction layer, CriticalPairOption option)
          Deprecated.  
static java.lang.Thread generateCriticalPairs(PairContainer pc)
          Generates critical pairs.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

createParser

public static Parser createParser(GraGra grammar,
                                  Graph hostGraph,
                                  Graph stopGraph,
                                  PairContainer pairs,
                                  ParserOption option,
                                  LayerFunction layer)
Deprecated. 

Here is a new parser created. The correct parser is chosen by the option. So the option must not be null. Anyway only the critical pairs can be null if they are not needed for the configured parser. This can happen e.g. for parser without optimization. If one of the parameters is null null is returned.

Parameters:
grammar - The graph grammar with all the rules.
hostGraph - The host graph to work on.
stopGraph - The stop graph stops the parser.
pairs - The critical pairs for optimization.
option - The option to configure the parser.
layer - The layer function.
Returns:
The new specific parser.
See Also:
generateCriticalPairs(agg.parser.PairContainer)

createParser

public static Parser createParser(GraGra grammar,
                                  Graph hostGraph,
                                  Graph stopGraph,
                                  PairContainer pairs,
                                  ParserOption option,
                                  RuleLayer layer)
Here is a new parser created. The correct parser is chosen by the option. So the option must not be null. Anyway only the critical pairs can be null if they are not needed for the configured parser. This can happen e.g. for parser without optimization. If one of the parameters is null null is returned.

Parameters:
grammar - The graph grammar with all the rules.
hostGraph - The host graph to work on.
stopGraph - The stop graph stops the parser.
pairs - The critical pairs for optimization.
option - The option to configure the parser.
layer - The layer function.
Returns:
The new specific parser.
See Also:
generateCriticalPairs(agg.parser.PairContainer)

createEmptyCriticalPairs

public static PairContainer createEmptyCriticalPairs(GraGra grammar,
                                                     LayerFunction layerFunc,
                                                     CriticalPairOption option)
Deprecated. 

Creates a empty container for critical pairs. This container has to be filled.

Parameters:
grammar - The graph grammar to generate the pairs for. This must not be null or null is returned.
layerFunc - The layer function. This can only be null if the critical pairs do not need them. (null can be returned.)
option - The option to configure the critical pairs. This must not be null or null is returned.
Returns:
A empty container.

createEmptyCriticalPairs

public static PairContainer createEmptyCriticalPairs(GraGra grammar,
                                                     CriticalPairOption option)
Creates a empty container for critical pairs. This container has to be filled.

Parameters:
grammar - The graph grammar to generate the pairs for. This must not be null or null is returned.
option - The option to configure the critical pairs. This must not be null or null is returned.
Returns:
A empty container.

createEmptyCriticalPairs

public static PairContainer createEmptyCriticalPairs(GraGra grammar,
                                                     int algorithm,
                                                     boolean layered)

generateCriticalPairs

public static java.lang.Thread generateCriticalPairs(PairContainer pc)
Generates critical pairs. These pairs are generated parallel. Use these generated pairs for the parser.

Parameters:
pc - The pair container to be filled.

generateCriticalPairs

public static PairContainer generateCriticalPairs(GraGra grammar,
                                                  LayerFunction layer,
                                                  CriticalPairOption option)
Deprecated. 

Creates and generates critical pairs. These pairs are generated parallel. Use these generated pairs for the parser.

Parameters:
grammar - The graph grammar to generate the pairs for. This must not be null or null is returned.
layer - The layer function. This can only be null if the critical pairs do not need them.
option - The option to configure the critical pairs. This must not be null.
Returns:
The genrated pairs in a container.

createLayerFunction

public static LayerFunction createLayerFunction(GraGra grammar,
                                                LayerOption option)
Deprecated. 

Creates a new layer function with a invalid layer.

Parameters:
grammar - The graph grammar to generate the layer function for. This must not be null or null is returned.
option - The option to configure the layer function. This must not be null or null is returned.
Returns:
The new layer function.