|
mjc | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
This type represents a java class or interface in the syntax tree
| Method Summary | |
void |
accumAllTypeSignatures(ArrayList accum)
Adds the signature CSourceClass of this, and of all nested types, to accum. |
void |
addMember(JMemberDeclarationType newMember)
Adds the given member to this type's interface and modifies sourceClass to include the new member |
void |
cachePassParameters(CContextType context)
Caches the arguments for the compiler passes. |
void |
checkInitializers(CContextType context)
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(CContextType context)
Checks the basic interfaces to make sure things generally look OK. |
CClassContextType |
createContext(CContextType parent)
Creates a lexical context for typechecking and control flow analysis on this. |
JFieldDeclarationType[] |
fields()
|
JPhylum[] |
fieldsAndInits()
Returns an array of the static and instance initializers for the type represented by this. |
void |
generateInterface(Main compiler,
CClass owner,
CMemberHost host,
String prefix,
boolean isAnon,
boolean isMember)
Generates a CSourceClass class signature singleton
for this declaration. |
ArrayList |
getAllMethods()
Walks up the extends hierarchy and adds all methods to the ArrayList returned. |
JConstructorDeclarationType |
getDefaultConstructor()
|
String |
ident()
Returns the identifier for this type declaration. |
ArrayList |
inners()
|
CClassType[] |
interfaces()
Returns the set of interfaces that this type implements or extends. |
boolean |
isAtTopLevel()
|
ArrayList |
methods()
|
long |
modifiers()
|
CClass |
owner()
Returns the logical owner of this type. |
void |
preprocessDependencies(CContextType context)
Performs preliminary processing on compilation units and types. |
void |
resolveSpecializers(CContextType context)
Computes the values of specializer expressions used to dispatch on compile-time constants. |
void |
resolveTopMethods()
Finds the top method of every declared method. |
void |
setDefaultConstructor(JConstructorDeclarationType defaultConstructor)
|
void |
setIdent(String ident)
|
void |
setInners(ArrayList v)
|
void |
setStatic()
Marks this type as static. |
void |
syntheticOuterThisInaccessible()
Records the fact that even though the class is an inner class, we should not generate an outer this for it, because the outer this is not accessible. |
void |
translateMJ(CContextType context)
Refactors this to include dispatchers for multimethods and other code necessary for running MultiJava code on a standard JVM. |
void |
typecheck(CContextType context)
Typechecks this type declaration in the context in which it appears. |
void |
unsetStatic()
Marks this type as non-static. |
| Methods inherited from interface org.multijava.mjc.JMemberDeclarationType |
accept, genComments, getCClass, getField, getMethod, isDeprecated |
| Methods inherited from interface org.multijava.util.compiler.PhylumType |
getTokenReference, setTokenReference |
| Methods inherited from interface org.multijava.javadoc.Annotatable |
javadocComment |
| Methods inherited from interface org.multijava.mjc.CompilerPassEnterable |
accept, checkInitializers, checkInterface, getTokenReference, preprocessDependencies, resolveSpecializers, translateMJ, typecheck |
| Methods inherited from interface java.lang.Comparable |
compareTo |
| Method Detail |
public void generateInterface(Main compiler,
CClass owner,
CMemberHost host,
String prefix,
boolean isAnon,
boolean isMember)
CSourceClass class signature singleton
for this declaration.
compiler - the compiler instance for which this singleton is
generatedowner - the class signature singleton for the logical outer
class of this, or null if this is a top level
declarationhost - the signature singleton of the context in which this
is declared, a CCompilationUnit for
top-level declarationsprefix - the prefix prepended to this declaration's
identifier to achieve the fully qualified
name, just the package name (using '/'
separators) for top-level classes, package
name plus $-delimited outer class names plus
synthetic index for inner classesisAnon - true if this is an anonymous class, in which
case the fully qualified name is just
prefix isMember - true if this is a member type, i.e., a nested type
that is not a local type or an anonymous classpublic CClassType[] interfaces()
public JPhylum[] fieldsAndInits()
public ArrayList getAllMethods()
public ArrayList methods()
public ArrayList inners()
public void setInners(ArrayList v)
public boolean isAtTopLevel()
public JFieldDeclarationType[] fields()
public JConstructorDeclarationType getDefaultConstructor()
public void setDefaultConstructor(JConstructorDeclarationType defaultConstructor)
public void setIdent(String ident)
public String ident()
ident in interface JMemberDeclarationTypepublic void addMember(JMemberDeclarationType newMember)
newMember - a member to be added to this typepublic CClass owner()
public long modifiers()
modifiers in interface JMemberDeclarationTypepublic void setStatic()
requires (* this.generateInterface(...) has not been invoked *); requires_redundantly (*sourceClass == null*); // !FIXME! Fix annotation - sourceClass is defined in the implementing classes ensures org.multijava.util.Utils.hasFlag(modifiers(),Constants.ACC_STATIC);
public void unsetStatic()
public void syntheticOuterThisInaccessible()
public void accumAllTypeSignatures(ArrayList accum)
public void preprocessDependencies(CContextType context)
throws PositionedError
PositionedError
public void checkInterface(CContextType context)
throws PositionedError
context - the context in which this
decl appears
PositionedError - an error with reference to
the source file
public void checkInitializers(CContextType context)
throws PositionedError
context - the context in which this class
declaration appears
PositionedError - if check fails
public void resolveSpecializers(CContextType context)
throws PositionedError
context - the context in which this class
declaration appears
PositionedError - if the check fails
public void resolveTopMethods()
throws PositionedError
resolveTopMethods in interface CompilerPassEnterablePositionedErrorpublic CClassContextType createContext(CContextType parent)
public void typecheck(CContextType context)
throws PositionedError
context - the context in which this type declaration appears
PositionedError - if any checks fail public void translateMJ(CContextType context)
public void cachePassParameters(CContextType context)
ensures arePassParametersCached;
CompilerPassEnterable
|
mjc | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||