public class Method extends Member
ASTNode
Modifier and Type | Field and Description |
---|---|
protected FormalList |
formalList
A list of formal parameters
|
protected java.lang.String |
name
The name of the method
|
protected java.lang.String |
returnType
The return type of the method
|
protected StmtList |
stmtList
A list of statements appearing in the method body
|
Constructor and Description |
---|
Method(int lineNum,
java.lang.String returnType,
java.lang.String name,
FormalList formalList,
StmtList stmtList)
Method constructor
|
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
accept(visitor.Visitor v,
java.lang.Object o)
Visitor method
|
FormalList |
getFormalList()
Get list of formal parameters
|
java.lang.String |
getName()
Get the name of this method
|
java.lang.String |
getReturnType()
Get the return type of this method
|
StmtList |
getStmtList()
Get list of statements from method body
|
getLineNum
protected java.lang.String returnType
protected java.lang.String name
protected FormalList formalList
protected StmtList stmtList
public Method(int lineNum, java.lang.String returnType, java.lang.String name, FormalList formalList, StmtList stmtList)
lineNum
- source line number corresponding to this AST nodereturnType
- the return type of this methodname
- the name of this methodformalList
- a list of formal parametersstmtList
- a list of statements appearing in the method bodypublic java.lang.String getReturnType()
public java.lang.String getName()
public FormalList getFormalList()
public StmtList getStmtList()