|
JML | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.multijava.util.Utils
org.multijava.util.compiler.Phylum
org.multijava.mjc.JPhylum
org.multijava.mjc.JMemberDeclaration
org.multijava.mjc.JTypeDeclaration
org.multijava.mjc.JClassDeclaration
This class represents a java class in the syntax tree
| Nested Class Summary |
| Nested classes inherited from class org.multijava.mjc.JTypeDeclaration |
JTypeDeclaration.WrapResult |
| Field Summary | |
protected CClassContextType |
self
|
private CVariableInfoTable |
staticInfo
|
protected CClassType |
superType
|
| Fields inherited from class org.multijava.mjc.JTypeDeclaration |
cachedContext, fieldsAndInits, ident, inners, instanceInit, interfaces, methods, modifiers, sourceClass, statInit, typevariables, uniqueSourceClass |
| Fields inherited from class org.multijava.mjc.JMemberDeclaration |
|
| Fields inherited from class org.multijava.util.compiler.Phylum |
|
| Fields inherited from class org.multijava.util.Utils |
DBG_LEVEL_HIGH, DBG_LEVEL_LOW, DBG_LEVEL_NO |
| Constructor Summary | |
JClassDeclaration(TokenReference where,
long modifiers,
String ident,
CTypeVariable[] typevariables,
CClassType superType,
CClassType[] interfaces,
ArrayList methods,
ArrayList inners,
JPhylum[] fieldsAndInits,
JavadocComment javadoc,
JavaStyleComment[] comment)
Constructs a class declaration in the parsing tree. |
|
| Method Summary | |
void |
accept(MjcVisitor p)
Accepts the specified visitor |
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. |
protected JConstructorDeclarationType |
constructDefaultConstructor()
Builds an AST node representing the default constructor for this class. |
protected JInitializerDeclaration |
constructInitializers(boolean isStatic)
Collects all initializers and builds a single method. |
CClassContextType |
createContext(CContextType parent)
Creates a class context for this class declaration. |
boolean |
hasConstructor()
Returns true if this class declaration contains an explicit constructor declaration. |
String |
ident()
Returns the identifier for this type declaration. |
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 |
setInterfaces(CClassType[] interfaces)
Sets the interfaces |
void |
setSuperClass(CClassType superType)
Sets the super class |
String |
superName()
|
void |
typecheck(CContextType context)
Typechecks this type declaration in the context in which it appears. |
| Methods inherited from class org.multijava.mjc.JMemberDeclaration |
genComments, getCClass, getField, getMethod, isDeprecated, javadocComment, setInterface |
| Methods inherited from class org.multijava.mjc.JPhylum |
check, check, check, check, fail, fail, fail, warn, warn, warn, warn |
| Methods inherited from class org.multijava.util.compiler.Phylum |
getTokenReference, setTokenReference |
| Methods inherited from class org.multijava.util.Utils |
assertTrue, assertTrue, combineArrays, escapeString, escapeString, fail, fail, getFilePath, hasFlag, hasOtherFlags, parsePathParts, relativePathTo, splitQualifiedName, splitQualifiedName, stripJavaModifiers, stripNonJavaModifiers, stripPrivateModifier, unescapeString, vectorToArray, vectorToIntArray |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.multijava.mjc.JTypeDeclarationType |
accumAllTypeSignatures, addMember, cachePassParameters, fields, fieldsAndInits, generateInterface, getAllMethods, getDefaultConstructor, inners, interfaces, isAtTopLevel, methods, modifiers, owner, resolveTopMethods, setDefaultConstructor, setIdent, setInners, setStatic, syntheticOuterThisInaccessible, translateMJ, unsetStatic |
| Methods inherited from interface org.multijava.mjc.JMemberDeclarationType |
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 |
checkInitializers, checkInterface, getTokenReference, preprocessDependencies, resolveSpecializers, translateMJ, typecheck |
| Methods inherited from interface java.lang.Comparable |
compareTo |
| Field Detail |
private CVariableInfoTable staticInfo
protected CClassContextType self
protected CClassType superType
| Constructor Detail |
public JClassDeclaration(TokenReference where,
long modifiers,
String ident,
CTypeVariable[] typevariables,
CClassType superType,
CClassType[] interfaces,
ArrayList methods,
ArrayList inners,
JPhylum[] fieldsAndInits,
JavadocComment javadoc,
JavaStyleComment[] comment)
where - the line of this node in the source codemodifiers - the list of modifiers of this classident - the short name of this classtypevariables - the type variables of this classsuperType - the type this class's superclassinterfaces - the names of this types's interfacesmethods - a list of JMethodDeclarationTypes giving the
methods of this typeinners - a list of JTypeDeclarationTypes giving the
inner classes (and interfaces) of this typefieldsAndInits - the fields and initializers of this type,
passed together because the order matters
for class and object initialization, members
of the array should be instances of
JFieldDeclarationType or
JClassBlockjavadoc - javadoc comments including whether this
type declaration is deprecatedcomment - regular java commentsJMethodDeclarationType,
JFieldDeclarationType,
JClassBlock| Method Detail |
public void setSuperClass(CClassType superType)
setSuperClass in interface JClassDeclarationTypepublic void setInterfaces(CClassType[] interfaces)
setInterfaces in interface JClassDeclarationType
public void preprocessDependencies(CContextType context)
throws PositionedError
preprocessDependencies in interface JTypeDeclarationTypePositionedError
public void checkInterface(CContextType context)
throws PositionedError
checkInterface in interface JTypeDeclarationTypecheckInterface in class JTypeDeclarationcontext - the context in which this
decl appears
PositionedError - an error with reference to the
source file public boolean hasConstructor()
checkInterface
to determine whether or not to create a default
constructor for this type.
hasConstructor in interface JClassDeclarationType
public void checkInitializers(CContextType context)
throws PositionedError
checkInitializers in interface JTypeDeclarationTypecheckInitializers in class JTypeDeclarationcontext - the context in which this class
declaration appears
PositionedError - if check fails
public void resolveSpecializers(CContextType context)
throws PositionedError
resolveSpecializers in interface JTypeDeclarationTypecontext - the context in which this class
declaration appears
PositionedError - if the check fails
public void typecheck(CContextType context)
throws PositionedError
typecheck in interface JTypeDeclarationTypetypecheck in class JTypeDeclarationcontext - the context in which this type declaration appears
PositionedError - if any checks fail public CClassContextType createContext(CContextType parent)
createContext in interface JClassDeclarationTypeparent - the parent context or null
protected JConstructorDeclarationType constructDefaultConstructor()
protected JInitializerDeclaration constructInitializers(boolean isStatic)
isStatic - build class (static) or instance initializers?public void accept(MjcVisitor p)
accept in interface JMemberDeclarationTypep - the visitorpublic String ident()
JTypeDeclarationType
ident in interface JTypeDeclarationTypeident in class JTypeDeclarationpublic String superName()
superName in interface JClassDeclarationType
|
JML | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||