dk.brics.grammar.operations
Class ProductionLengthNormalizer

java.lang.Object
  extended by dk.brics.grammar.operations.ProductionLengthNormalizer

public class ProductionLengthNormalizer
extends Object

Normalizes grammars to have at most two entities in each production.


Constructor Summary
ProductionLengthNormalizer(PrintWriter out)
          Constructs a new normalizer.
 
Method Summary
 Grammar normalize(Grammar g)
          Normalizes the given grammar.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ProductionLengthNormalizer

public ProductionLengthNormalizer(PrintWriter out)
Constructs a new normalizer.

Parameters:
out - print writer for messages (if a grammar contains unordered productions)
Method Detail

normalize

public Grammar normalize(Grammar g)
Normalizes the given grammar. The input grammar is not modified, but the output grammar reuses the Entity objects from the input grammar.

Parameters:
g - input grammar
Returns:
output grammar


Copyright © 2005-2008 Anders Møller.