treeNodes
Class CaseExpression

java.lang.Object
  extended by generalHelpers.TreeNode
      extended by treeNodes.AbstractExpression
          extended by treeNodes.CaseExpression

public class CaseExpression
extends AbstractExpression

Defines AST constructor 'typcase'.

See TreeNode for full documentation.


Field Summary
protected  ListNode<Branch> cases
           
protected  AbstractExpression expr
           
 
Fields inherited from class generalHelpers.TreeNode
lineNumber
 
Constructor Summary
CaseExpression(int lineNumber, AbstractExpression a1, ListNode<Branch> a2)
          Creates "typcase" AST node.
 
Method Summary
 TreeNode copy()
          Creates a copy of this node.
 void dump(java.io.Writer out, int n)
          Pretty-prints this node to this output stream.
 void dumpWithTypes(java.io.Writer out, int n)
           
 ListNode<Branch> getBranches()
           
 
Methods inherited from class treeNodes.AbstractExpression
dumpType, getType, setType
 
Methods inherited from class generalHelpers.TreeNode
copyAbstractSymbol, copyBoolean, dumpAbstractSymbol, dumpBoolean, dumpLine, getLineNumber, set
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

expr

protected AbstractExpression expr

cases

protected ListNode<Branch> cases
Constructor Detail

CaseExpression

public CaseExpression(int lineNumber,
                      AbstractExpression a1,
                      ListNode<Branch> a2)
Creates "typcase" AST node.

Parameters:
lineNumber - the line in the source file from which this node came.
a0 - initial value for expr
a1 - initial value for cases
Method Detail

copy

public TreeNode copy()
Description copied from class: TreeNode
Creates a copy of this node.

Specified by:
copy in class TreeNode
Returns:
a copy of this node

getBranches

public ListNode<Branch> getBranches()

dump

public void dump(java.io.Writer out,
                 int n)
          throws java.io.IOException
Description copied from class: TreeNode
Pretty-prints this node to this output stream.

Specified by:
dump in class TreeNode
Parameters:
out - the output stream
n - the number of spaces to indent the output
Throws:
java.io.IOException

dumpWithTypes

public void dumpWithTypes(java.io.Writer out,
                          int n)
                   throws java.io.IOException
Specified by:
dumpWithTypes in class AbstractExpression
Throws:
java.io.IOException