Class ProcDeclNode

java.lang.Object
  extended by ASTNode
      extended by DeclNode
          extended by ProcDeclNode

public class ProcDeclNode
extends DeclNode

An AST node representing a function or procedure declaration: "FUNCTION name(parameters) RETURN type IS decls BEGIN stmts END;" or "PROCEDURE name(parameters) IS decls BEGIN stmts END;".


Nested Class Summary
static class ProcDeclNode.Param
          A formal parameter.
 
Nested classes/interfaces inherited from class ASTNode
ASTNode.DataType
 
Field Summary
 IdNode id
          The name of the procedure.
 ASTNode.DataType returnType
          The return type of the procedure.
 
Constructor Summary
ProcDeclNode(IdNode id, java.util.List<ProcDeclNode.Param> params, ASTNode.DataType returnType, BlockNode body)
          Creates a new ProcDeclNode.
 
Method Summary
 void unparse(java.io.PrintWriter p, int level)
          Prints a source representation of the tree rooted at this node on output stream p.
 
Methods inherited from class ASTNode
indent
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

id

public final IdNode id
The name of the procedure.


returnType

public final ASTNode.DataType returnType
The return type of the procedure. Is null for procedures.

Constructor Detail

ProcDeclNode

public ProcDeclNode(IdNode id,
                    java.util.List<ProcDeclNode.Param> params,
                    ASTNode.DataType returnType,
                    BlockNode body)
Creates a new ProcDeclNode.

Parameters:
id - the name of the procedure.
returnType - the return type of the procedure, or null.
parameters - the list of parameters. May be a zero-length list, but must not be null.
body - the procedure body.
Method Detail

unparse

public void unparse(java.io.PrintWriter p,
                    int level)
Prints a source representation of the tree rooted at this node on output stream p.

Specified by:
unparse in class ASTNode
Parameters:
p - the place to display the output.
level - the number of levels of indentation to use if the output requires more than one line.