|
mjc | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
This type represents a single Java compilation unit (typically a file in a file-based compiler like this) in the AST. The production for a compilation unit is the main entry point in Java parser grammar.
| Method Summary | |
void |
accept(MjcVisitor p)
Accepts the specified visitor |
CSourceClass[] |
allTypeSignatures()
Returns the CSourceClass objects representing the type signatures of the types declared in this compilatoin unit and as nested types. |
void |
cachePassParameters(Main compiler,
Destination destination)
Caches the arguments for the compiler passes. |
void |
checkInitializers(Main compiler)
Checks the static initializers created during the checkInterface pass and performs some other checks that can be performed simply before full blown typechecking. |
void |
checkInterface(Main compiler)
Checks the basic interfaces to make sure things generally look OK. |
boolean |
declaresGF(String qualifiedName)
Returns true iff this compilation unit contains a declaration for a generic function with the given fully qualified name. |
boolean |
declaresType(String qualifiedName)
Returns true iff this compilation unit contains a declaration for a type with the given fully qualified name. |
File |
file()
Returns the file associated with this compilation unit. |
String |
fileNameIdent()
Returns the Java identifier associated with the name of the file containing this compilation unit. |
MJGenericFunctionDecl[] |
gfDeclarations()
|
JClassOrGFImportType[] |
importedClasses()
|
JClassOrGFImportType[] |
importedGFs()
|
JPackageImportType[] |
importedPackages()
|
JClassOrGFImportType[] |
importedUnits()
Returns an array of the class and generic function imports for this compilation unit. |
JPackageName |
packageName()
|
String |
packageNameAsString()
|
void |
preprocessDependencies(Main compiler)
Performs preliminary processing on compilation units and types. |
void |
resolveSpecializers()
Resolves value specializer expressions to the compile-time constants they represent. |
void |
resolveTopMethods()
Finds the top method of every declared method. |
ArrayList |
tlMethods()
Returns the AST subtrees for the augmenting method declarations. |
void |
translateMJ(Main compiler)
Refactors this to include dispatchers for multimethods and other code necessary for running MultiJava code on a standard JVM. |
void |
typecheck(Main compiler)
Typechecks this compilation unit. |
JTypeDeclarationType[] |
typeDeclarations()
|
| Methods inherited from interface org.multijava.mjc.CompilerPassEnterable |
checkInitializers, checkInterface, getTokenReference, preprocessDependencies, translateMJ, typecheck |
| Methods inherited from interface java.lang.Comparable |
compareTo |
| Method Detail |
public String packageNameAsString()
public File file()
public String fileNameIdent()
public JPackageName packageName()
public JPackageImportType[] importedPackages()
public JClassOrGFImportType[] importedClasses()
public JTypeDeclarationType[] typeDeclarations()
public MJGenericFunctionDecl[] gfDeclarations()
public CSourceClass[] allTypeSignatures()
public boolean declaresType(String qualifiedName)
qualifiedName - a fully qualified name with parts
separated by '/' not '.'public boolean declaresGF(String qualifiedName)
qualifiedName - a fully qualified name with parts
separated by '/' not '.'public ArrayList tlMethods()
public JClassOrGFImportType[] importedUnits()
public JClassOrGFImportType[] importedGFs()
public void preprocessDependencies(Main compiler)
throws PositionedError
PositionedError
public void checkInterface(Main compiler)
throws PositionedError
PositionedError - an error with reference
to the source file
public void checkInitializers(Main compiler)
throws PositionedError
compiler - the compiler that is calling (passed down
through the AST via CContextType subtypes
and used for error reporting)
PositionedError - if check fails
public void resolveSpecializers()
throws PositionedError
resolveSpecializers in interface CompilerPassEnterablePositionedError
public void resolveTopMethods()
throws PositionedError
resolveTopMethods in interface CompilerPassEnterablePositionedError
public void typecheck(Main compiler)
throws PositionedError
compiler - the compiler that is calling
PositionedError - if a check fails that we cannot
recover from public void accept(MjcVisitor p)
accept in interface CompilerPassEnterablep - the visitorpublic void translateMJ(Main compiler)
public void cachePassParameters(Main compiler,
Destination destination)
ensures arePassParametersCached;
CompilerPassEnterable
|
mjc | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||