Class ProcDeclNode
java.lang.Object
ASTNode
DeclNode
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;".
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 java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
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.
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.
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.