|
ESC/Java2 © 2003,2004,2005 David Cok and Joseph Kiniry © 2005 UCD Dublin © 2003,2004 Radboud University Nijmegen © 1999,2000 Compaq Computer Corporation © 1997,1998,1999 Digital Equipment Corporation All Rights Reserved |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavafe.tc.CheckCompilationUnit
This module is responsible for handling CompilationUnit
-level type
checks.
In practice, these are mostly checks that the set of import declarations is legal.
Field Summary | |
private static ASTDecoration |
checkedField
A new field for CompilationUnits: iff it is non-null then we have already checked that CompilationUnit. |
Constructor Summary | |
CheckCompilationUnit()
|
Method Summary | |
static void |
checkCompilationUnit(CompilationUnit cu)
Check a CompilationUnit .
|
private static void |
checkImports(CompilationUnit cu)
Check a CompilationUnit |
private static void |
checkPublic(CompilationUnit cu)
Check a CompilationUnit |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private static ASTDecoration checkedField
Constructor Detail |
public CheckCompilationUnit()
Method Detail |
public static void checkCompilationUnit(CompilationUnit cu)
CompilationUnit
.
If this method is called multiple times on the same
CompilationUnit
, it has no effect the second and later
times.
Precondition: cu
must have already been loaded by
OutsideEnv
.
Any resulting errors or warnings are reported via
ErrorSet
.
private static void checkPublic(CompilationUnit cu)
CompilationUnit to make sure that the only type that may
be declared public in it is the one with the same name as the file it occurs
in. Violations result in warnings only.
private static void checkImports(CompilationUnit cu)
CompilationUnit to make sure that each import is
individually well formed.
In particular,
- Type in single import must exist
- Single imports from other packages must be public (not implemented)
- Packages in all imports must be "accessible" (disabled)
This routine does not check legality of pairs of import statements or
import statements and the types declared in the rest of the
CompilationUnit.
|
ESC/Java2 © 2003,2004,2005 David Cok and Joseph Kiniry © 2005 UCD Dublin © 2003,2004 Radboud University Nijmegen © 1999,2000 Compaq Computer Corporation © 1997,1998,1999 Digital Equipment Corporation All Rights Reserved |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |