dk.brics.grammar.operations
Class Unfolder
java.lang.Object
dk.brics.grammar.operations.Unfolder
public class Unfolder
- extends Object
Grammar unfolder.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Unfolder
public Unfolder(PrintWriter out)
- Constructs a new unfolder.
- Parameters:
out
- print writer for messages
unfold
public Grammar unfold(Grammar g,
int number,
String lpar,
String rpar)
throws IllegalArgumentException
- Unfolds the given grammar.
- Parameters:
g
- grammarnumber
- number of times to unfoldlpar
- left parenthesis symbolsrpar
- 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.