dk.brics.grammar.operations
Class Unfolder

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

public class Unfolder
extends Object

Grammar unfolder.


Constructor Summary
Unfolder(PrintWriter out)
          Constructs a new unfolder.
 
Method Summary
 Grammar unfold(Grammar g, int number, String lpar, String rpar)
          Unfolds the given grammar.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Unfolder

public Unfolder(PrintWriter out)
Constructs a new unfolder.

Parameters:
out - print writer for messages
Method Detail

unfold

public Grammar unfold(Grammar g,
                      int number,
                      String lpar,
                      String rpar)
               throws IllegalArgumentException
Unfolds the given grammar.

Parameters:
g - grammar
number - number of times to unfold
lpar - left parenthesis symbols
rpar - right parenthesis symbols (in same order as the corresponding left parentheses), disjoint from left parenthesis symbols
Returns:
new grammar
Throws:
IllegalArgumentException - if the grammar cannot be unfolded with the given parentheses


Copyright © 2005-2008 Anders Møller.