Package jminusminus
Class JInterfaceDeclaration
java.lang.Object
jminusminus.JAST
jminusminus.JInterfaceDeclaration
- All Implemented Interfaces:
JTypeDecl
A representation of an interface declaration.
-
Field Summary
Fields inherited from class jminusminus.JAST
compilationUnit, line
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionPerforms semantic analysis on this AST and returns the (possibly modified) AST.void
Performs code generation for this AST.void
declareThisType
(Context context) Declares this type in the parent context.name()
Returns the name of this type declaration.void
preAnalyze
(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.void
toJSON
(JSONElement json) Stores information about this AST in JSON format.Methods inherited from class jminusminus.JAST
line, partialCodegen, unescape
-
Constructor Details
-
JInterfaceDeclaration
public JInterfaceDeclaration(int line, ArrayList<String> mods, String name, ArrayList<TypeName> superInterfaces, ArrayList<JMember> interfaceBlock) Constructs an AST node for an interface declaration.- Parameters:
line
- line in which the interface declaration occurs in the source file.mods
- class modifiers.name
- class name.superInterfaces
- super class types.interfaceBlock
- interface block.
-
-
Method Details
-
declareThisType
Declares this type in the parent context. Called before pre-analysis so that it is available in the preAnalyze() method of other types.- Specified by:
declareThisType
in interfaceJTypeDecl
- Parameters:
context
- the parent (compilation unit) context.
-
preAnalyze
Pre-analyzes the members of this declaration in the parent context.- Specified by:
preAnalyze
in interfaceJTypeDecl
- Parameters:
context
- the parent (compilation unit) context.
-
name
Returns the name of this type declaration. -
superType
Returns the type of the extended class for a class or java.lang.Object for an interface. -
superInterfaces
Returns the types of the implemented interfaces for a class or extended interfaces for an interface.- Specified by:
superInterfaces
in interfaceJTypeDecl
- Returns:
- the types of the implemented interfaces for a class or extended interfaces for an interface.
-
thisType
Returns the type that this type declaration defines. -
analyze
Performs semantic analysis on this AST and returns the (possibly modified) AST. -
codegen
Performs code generation for this AST. -
toJSON
Stores information about this AST in JSON format.
-