dk.brics.grammar.operations
Class Unparser

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

public class Unparser
extends Object

AST unparser.


Constructor Summary
Unparser(Grammar g)
          Constructs a new AST unparser.
 
Method Summary
 String unparse(AST a)
          Unparses the given AST.
 void unparse(AST a, PrintWriter p)
          Unparses the given AST.
 void unparse(Node n, PrintWriter p, String x)
          Unparses the given node representing a sub-AST.
 String unparse(Node n, String x)
          Unparses the given node representing a sub-AST.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Unparser

public Unparser(Grammar g)
Constructs a new AST unparser.

Parameters:
g - grammar
Method Detail

unparse

public String unparse(AST a)
Unparses the given AST.

Parameters:
a - AST
Returns:
unparsed AST

unparse

public void unparse(AST a,
                    PrintWriter p)
Unparses the given AST.

Parameters:
a - AST
p - print writer for output

unparse

public void unparse(Node n,
                    PrintWriter p,
                    String x)
Unparses the given node representing a sub-AST.

Parameters:
n - node
p - print writer for output
x - original string

unparse

public String unparse(Node n,
                      String x)
Unparses the given node representing a sub-AST.

Parameters:
n - node
x - original string
Returns:
unparsed sub-AST


Copyright © 2005-2008 Anders Møller.