fmrisc.Syntax
Class ASTBase

java.lang.Object
  extended by fmrisc.Syntax.ASTBase
All Implemented Interfaces:
AST
Direct Known Subclasses:
DeclarationBase, ExpressionBase, Identifier, Number, SelectorBase, TypeBase, TypedIdentifier, ValuedIdentifier

public abstract class ASTBase
extends java.lang.Object
implements AST

Base class of abstract syntax trees.


Constructor Summary
ASTBase()
           
 
Method Summary
 void print(java.io.PrintWriter out)
          Prints text representation on out (without new line termination).
abstract  void printCore(java.io.PrintWriter out)
          Prints text representation of tree on out (without new line termination).
 void printParens(java.io.PrintWriter out)
          Prints text representation on out (without new line termination) with parentheses around the whole expression.
 java.lang.String toString()
          returns string representation of tree
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface fmrisc.Syntax.AST
accept
 

Constructor Detail

ASTBase

public ASTBase()
Method Detail

print

public void print(java.io.PrintWriter out)
Prints text representation on out (without new line termination). If ASTUtil.setPrintParens(true) was called, parentheses are printed around every (sub)expression.

Specified by:
print in interface AST
Parameters:
out - the stream on which the text is written

printParens

public void printParens(java.io.PrintWriter out)
Prints text representation on out (without new line termination) with parentheses around the whole expression.

Specified by:
printParens in interface AST
Parameters:
out - the stream on which the text is written

printCore

public abstract void printCore(java.io.PrintWriter out)
Prints text representation of tree on out (without new line termination).

Specified by:
printCore in interface AST
Parameters:
out - the stream on which the text is written

toString

public java.lang.String toString()
returns string representation of tree

Specified by:
toString in interface AST
Overrides:
toString in class java.lang.Object
Returns:
the string representation