Package jminusminus
Class JMethodDeclaration
java.lang.Object
jminusminus.JAST
jminusminus.JMethodDeclaration
- All Implemented Interfaces:
- JMember
- Direct Known Subclasses:
- JConstructorDeclaration
The AST node for a method declaration.
- 
Field SummaryFieldsModifier and TypeFieldDescriptionprotected JBlockMethod body.protected MethodContextMethod context (built in analyze()).protected StringMethod descriptor (computed in preAnalyze()).Exceptions thrown.protected booleanIs this method abstract?protected booleanIs this method private?protected booleanIs this method static?Method modifiers.protected StringMethod name.protected ArrayList<JFormalParameter>The formal parameters.protected TypeReturn type.Fields inherited from class jminusminus.JASTcompilationUnit, line
- 
Constructor SummaryConstructorsConstructorDescriptionJMethodDeclaration(int line, ArrayList<String> mods, String name, Type returnType, ArrayList<JFormalParameter> params, ArrayList<TypeName> exceptions, JBlock body) Constructs an AST node for a method declaration.
- 
Method SummaryModifier and TypeMethodDescriptionPerforms semantic analysis on this AST and returns the (possibly modified) AST.voidPerforms code generation for this AST.voidpartialCodegen(Context context, CLEmitter partial) Generates a partial class for a type, reflecting only the member information required to do analysis.voidpreAnalyze(Context context, CLEmitter partial) Declares the member names in the specified (class) context and generates the member headers in the partial class.voidtoJSON(JSONElement json) Stores information about this AST in JSON format.
- 
Field Details- 
modsMethod modifiers.
- 
nameMethod name.
- 
returnTypeReturn type.
- 
paramsThe formal parameters.
- 
exceptionsExceptions thrown.
- 
bodyMethod body.
- 
contextMethod context (built in analyze()).
- 
descriptorMethod descriptor (computed in preAnalyze()).
- 
isAbstractprotected boolean isAbstractIs this method abstract?
- 
isStaticprotected boolean isStaticIs this method static?
- 
isPrivateprotected boolean isPrivateIs this method private?
 
- 
- 
Constructor Details- 
JMethodDeclarationpublic JMethodDeclaration(int line, ArrayList<String> mods, String name, Type returnType, ArrayList<JFormalParameter> params, ArrayList<TypeName> exceptions, JBlock body) Constructs an AST node for a method declaration.- Parameters:
- line- line in which the method declaration occurs in the source file.
- mods- modifiers.
- name- method name.
- returnType- return type.
- params- the formal parameters.
- exceptions- exceptions thrown.
- body- method body.
 
 
- 
- 
Method Details- 
preAnalyzeDeclares the member names in the specified (class) context and generates the member headers in the partial class.- Specified by:
- preAnalyzein interface- JMember
- Parameters:
- context- class context in which names are resolved.
- partial- the code emitter.
 
- 
analyzePerforms semantic analysis on this AST and returns the (possibly modified) AST.
- 
partialCodegenGenerates a partial class for a type, reflecting only the member information required to do analysis.- Overrides:
- partialCodegenin class- JAST
- Parameters:
- context- the parent (class) context.
- partial- the code emitter.
 
- 
codegenPerforms code generation for this AST.
- 
toJSONStores information about this AST in JSON format.
 
-