
176 An Introduction to Compiler Construction in a Java World
5.2.1 Class Declarations
The codegen() method for JClassDeclaration does the following:
• It computes the fully- qualified name for the class, taking any package name into
account.
• It invokes an addClass() on the CLEmitter for adding the class header to the start
of the class file.
• If there is no explicit constructor with no arguments defined for the class, it invokes
the private method codegenImplicitConstructor() to generate code for the implicit
constructor as required by the language.
• It generates code for its members by sending the codegen() message to each of them.
• If there are any ...