Package jminusminus
Class JClassDeclaration
java.lang.Object
jminusminus.JAST
jminusminus.JClassDeclaration
- All Implemented Interfaces:
- JTypeDecl
A representation of a class declaration.
- 
Field SummaryFields inherited from class jminusminus.JASTcompilationUnit, line
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionPerforms semantic analysis on this AST and returns the (possibly modified) AST.voidPerforms code generation for this AST.voiddeclareThisType(Context context) Declares this type in the parent context.Returns the initializations for instance fields (expressed as assignment statements).name()Returns the name of this type declaration.voidpreAnalyze(Context context) Pre-analyzes the members of this declaration in the parent context.Returns the types of the implemented interfaces for a class or extended interfaces for an interface.Returns the type of the extended class for a class or java.lang.Object for an interface.thisType()Returns the type that this type declaration defines.voidtoJSON(JSONElement json) Stores information about this AST in JSON format.Methods inherited from class jminusminus.JASTline, partialCodegen, unescape
- 
Constructor Details- 
JClassDeclarationpublic JClassDeclaration(int line, ArrayList<String> mods, String name, Type superType, ArrayList<TypeName> superInterfaces, ArrayList<JMember> classBlock) Constructs an AST node for a class declaration.- Parameters:
- line- line in which the class declaration occurs in the source file.
- mods- class modifiers.
- name- class name.
- superType- super class type.
- superInterfaces- implemented interfaces.
- classBlock- class block.
 
 
- 
- 
Method Details- 
instanceFieldInitializationsReturns the initializations for instance fields (expressed as assignment statements).- Returns:
- the initializations for instance fields (expressed as assignment statements).
 
- 
declareThisTypeDeclares this type in the parent context. Called before pre-analysis so that it is available in the preAnalyze() method of other types.- Specified by:
- declareThisTypein interface- JTypeDecl
- Parameters:
- context- the parent (compilation unit) context.
 
- 
preAnalyzePre-analyzes the members of this declaration in the parent context.- Specified by:
- preAnalyzein interface- JTypeDecl
- Parameters:
- context- the parent (compilation unit) context.
 
- 
nameReturns the name of this type declaration.
- 
thisTypeReturns the type that this type declaration defines.
- 
superTypeReturns the type of the extended class for a class or java.lang.Object for an interface.
- 
superInterfacesReturns the types of the implemented interfaces for a class or extended interfaces for an interface.- Specified by:
- superInterfacesin interface- JTypeDecl
- Returns:
- the types of the implemented interfaces for a class or extended interfaces for an interface.
 
- 
analyzePerforms semantic analysis on this AST and returns the (possibly modified) AST.
- 
codegenPerforms code generation for this AST.
- 
toJSONStores information about this AST in JSON format.
 
-