treeNodes
Class Method

java.lang.Object
  extended by generalHelpers.TreeNode
      extended by treeNodes.AbstractFeature
          extended by treeNodes.Method

public class Method
extends AbstractFeature

Defines AST constructor 'method'.

See TreeNode for full documentation.


Field Summary
protected  AbstractExpression expr
           
protected  ListNode<Formal> formals
           
protected  AbstractSymbol return_type
           
 
Fields inherited from class treeNodes.AbstractFeature
name
 
Fields inherited from class generalHelpers.TreeNode
lineNumber
 
Constructor Summary
Method(int lineNumber, AbstractSymbol a1, ListNode<Formal> a2, AbstractSymbol a3, AbstractExpression a4)
          Creates "method" 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)
           
 AbstractExpression getExpr()
           
 ListNode<Formal> getFormals()
           
 
Methods inherited from class treeNodes.AbstractFeature
getName
 
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

formals

protected ListNode<Formal> formals

return_type

protected AbstractSymbol return_type

expr

protected AbstractExpression expr
Constructor Detail

Method

public Method(int lineNumber,
              AbstractSymbol a1,
              ListNode<Formal> a2,
              AbstractSymbol a3,
              AbstractExpression a4)
Creates "method" AST node.

Parameters:
lineNumber - the line in the source file from which this node came.
a0 - initial value for name
a1 - initial value for formals
a2 - initial value for return_type
a3 - initial value for expr
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

getExpr

public AbstractExpression getExpr()

getFormals

public ListNode<Formal> getFormals()

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 AbstractFeature
Throws:
java.io.IOException