AST
node type MethodDecl

General Info

Production
MethodDecl : Decl ::= Type:Access ParamDecl* Body:Block;
Type Hierarchy:
java.lang.Object
  extended by AST.ASTNode<ASTNode>
      extended by AST.BlockStmt
          extended by AST.Decl
              extended by AST.MethodDecl
All Implemented Interfaces:
java.lang.Cloneable, java.lang.Iterable<ASTNode>

Description

Source
Declared in spec/picojava-method.ast at line 2

Member Filters

API level:

Aspect:

Constructors

public MethodDecl()
public MethodDecl(java.lang.String p0,
                  Access p1,
                  List<ParamDecl> p2,
                  Block p3)

Attributes

syn boolean endsWithReturn()
Overrides:endsWithReturn in class BlockStmt
Source
Declared in spec/ErrorCheck.jrag at line 11
Aspect
ErrorCheck
syn Decl declarationOf(java.lang.String name,
                   List argList)
Overrides:declarationOf in class BlockStmt
Source
Declared in spec/NameResolution.jrag at line 58
Aspect
NameResolution
syn TypeDecl type()
Specified by:type in class Decl
Source
Declared in spec/TypeAnalysis.jrag at line 4
Aspect
TypeAnalysis
syn boolean hasEnclosingClass()
Source
Declared in spec/TypeAnalysis.jrag at line 11
Aspect
TypeAnalysis
Source
Declared in spec/TypeAnalysis.jrag at line 8
Aspect
TypeAnalysis

Methods

public MethodDecl clone()
                 throws java.lang.CloneNotSupportedException
Overrides:clone in class Decl
Throws:
java.lang.CloneNotSupportedException
public MethodDecl copy()
Overrides:copy in class ASTNode<ASTNode>
Create a deep copy of the AST subtree at this node. The copy is dangling, i.e. has no parent.
Overrides:fullCopy in class ASTNode<ASTNode>
Returns:
dangling copy of the subtree at this node
public void collectErrors(java.util.Collection c)
Overrides:collectErrors in class ASTNode<ASTNode>
Source
Declared in spec/ErrorCheck.jrag at line 5
Aspect
ErrorCheck
public void prettyPrint(java.lang.StringBuilder sb,
                        int t)
Source
Declared in spec/PrettyPrint.jadd at line 2
Aspect
PrettyPrint
public void init$Children()
Initializes the child array to the correct size. Initializes List and Opt nta children.
Overrides:init$Children in class Decl
protected int numChildren()
Overrides:numChildren in class Decl
public boolean mayHaveRewrite()
Overrides:mayHaveRewrite in class Decl
public void flushCache()
Overrides:flushCache in class Decl
public void flushCollectionCache()
Overrides:flushCollectionCache in class Decl
public void setName(java.lang.String value)
Replaces the lexeme Name.
Overrides:setName in class Decl
Parameters:
value - The new value for the lexeme Name.
public java.lang.String getName()
Retrieves the value for the lexeme Name.
Overrides:getName in class Decl
Returns:
The value for the lexeme Name.
public void setType(Access node)
Replaces the Type child.
Parameters:
node - The new node to replace the Type child.
public Access getType()
Retrieves the Type child.
Returns:
The current node used as the Type child.
Retrieves the Type child.

This method does not invoke AST transformations.

Returns:
The current node used as the Type child.
public void setParamDeclList(List<ParamDecl> list)
Replaces the ParamDecl list.
Parameters:
list - The new list node to be used as the ParamDecl list.
public int getNumParamDecl()
Retrieves the number of children in the ParamDecl list.
Returns:
Number of children in the ParamDecl list.
Retrieves the number of children in the ParamDecl list. Calling this method will not trigger rewrites.
Returns:
Number of children in the ParamDecl list.
public ParamDecl getParamDecl(int i)
Retrieves the element at index i in the ParamDecl list.
Parameters:
i - Index of the element to return.
Returns:
The element at position i in the ParamDecl list.
public boolean hasParamDecl()
Check whether the ParamDecl list has any children.
Returns:
true if it has at least one child, false otherwise.
public void addParamDecl(ParamDecl node)
Append an element to the ParamDecl list.
Parameters:
node - The element to append to the ParamDecl list.
public void setParamDecl(ParamDecl node,
                         int i)
Replaces the ParamDecl list element at index i with the new node node.
Parameters:
node - The new node to replace the old list element.
i - The list index of the node to be replaced.
Retrieves the ParamDecl list.
Returns:
The node representing the ParamDecl list.
Retrieves the ParamDecl list.

This method does not invoke AST transformations.

Returns:
The node representing the ParamDecl list.
Retrieves the ParamDecl list.
Returns:
The node representing the ParamDecl list.
Retrieves the ParamDecl list.

This method does not invoke AST transformations.

Returns:
The node representing the ParamDecl list.
public void setBody(Block node)
Replaces the Body child.
Parameters:
node - The new node to replace the Body child.
public Block getBody()
Retrieves the Body child.
Returns:
The current node used as the Body child.
Retrieves the Body child.

This method does not invoke AST transformations.

Returns:
The current node used as the Body child.
Overrides:rewriteTo in class Decl

Fields

protected java.util.Map declarationOf_String_List_visited
protected java.util.Map declarationOf_String_List_values
protected int type_visited
protected boolean type_computed

Inherited Members