dk.brics.grammar.ast
Class AST

java.lang.Object
  extended by dk.brics.grammar.ast.AST

public class AST
extends Object

Abstract syntax tree (AST).


Constructor Summary
AST(BranchNode root, String x)
          Constructs a new AST.
 
Method Summary
 String getOriginalString()
          Returns the original string.
 BranchNode getRoot()
          Returns the root node.
 String toString()
          Returns string representation of this AST.
 void traverse(NodeVisitor v)
          Traverses this AST bottom-up and applies the visitor to all nodes.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AST

public AST(BranchNode root,
           String x)
Constructs a new AST.

Parameters:
root - root node
x - original string
Method Detail

getOriginalString

public String getOriginalString()
Returns the original string.

Returns:
original string

getRoot

public BranchNode getRoot()
Returns the root node.

Returns:
root node

toString

public String toString()
Returns string representation of this AST.

Overrides:
toString in class Object

traverse

public void traverse(NodeVisitor v)
Traverses this AST bottom-up and applies the visitor to all nodes.

Parameters:
v - AST visitor


Copyright © 2005-2008 Anders Møller.