|
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
org.multijava.mjc.MJGenericFunctionDecl
This class represents a group of method declarations, all sharing the same name, that together form the top of one or more overloaded external generic function lattices. It corresponds to the anchor class for an external generic function.
| Nested Class Summary |
| Nested classes inherited from class org.multijava.mjc.JTypeDeclaration |
JTypeDeclaration.WrapResult |
| Field Summary | |
(package private) MJTopLevelMethodDeclaration[] |
externalMethods
Stores the external methods declared within this anchor declaration. |
| Fields inherited from class org.multijava.mjc.JClassDeclaration |
self, 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.mjc.JPhylum |
EMPTY |
| 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 | |
MJGenericFunctionDecl(TokenReference where,
long modifiers,
String ident,
MJTopLevelMethodDeclaration[] methods)
Constructs a generic function anchor declaration in the parsing tree. |
|
| Method Summary | |
void |
accept(MjcVisitor v)
Accepts the specified visitor |
void |
checkInterface(CContextType context)
Checks the basic interfaces to make sure things generally look OK. |
Object |
clone()
Produces a copy of this declaration, including a deep copy of the external method declarations housed here-in. |
MJTopLevelMethodDeclaration[] |
externalMethods()
Return the top-level methods in this GF |
protected CSourceClass |
makeSignature(Main compiler,
CClass owner,
CMemberHost host,
String prefix,
boolean isAnon,
boolean isMember)
Generates the signature object for this. |
protected String |
methodIdent()
Returns the ident of the methods contained in this generic function. |
protected JMethodDeclarationType[] |
methodsToBeWrapped()
Returns an array of the methods to be considered for refactoring into dispatchers during the translateMJ pass. |
protected boolean |
registerSignature()
Registers the signature of this declaration with the name space manager in CTopLevel. |
void |
resolveExtMethods(CContextType context)
Makes sure that all in-scope external generic functions are added to the appropriate augmentation maps before top method searches occur in later passes. |
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 |
typecheck(CContextType context)
Typechecks this generic function declaration in the context in which it appears. |
protected CWarning |
uniqueSourceWarning()
Returns the appropriate warning message when another class has been declared whose signature matches the signature of this. |
| Methods inherited from class org.multijava.mjc.JClassDeclaration |
checkInitializers, constructDefaultConstructor, constructInitializers, createContext, hasConstructor, ident, preprocessDependencies, setInterfaces, setSuperClass, superName |
| 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 |
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, 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 |
MJTopLevelMethodDeclaration[] externalMethods
| Constructor Detail |
public MJGenericFunctionDecl(TokenReference where,
long modifiers,
String ident,
MJTopLevelMethodDeclaration[] methods)
where - the line of this node in the source codemodifiers - the modifiers of this anchorident - the short name of thie anchormethods - the MJTopLevelMethodDeclarations that make up this
generic function, must have non-zero length and all
non-null members| Method Detail |
protected CSourceClass makeSignature(Main compiler,
CClass owner,
CMemberHost host,
String prefix,
boolean isAnon,
boolean isMember)
makeSignature in class JTypeDeclarationcompiler - the compiler instance for which this signature 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 classprotected boolean registerSignature()
CTopLevel.
also requires sourceClass != null && sourceClass instanceof CSourceGFCollection;
registerSignature in class JTypeDeclarationCTopLevel#addGFCollection( CGFCollection )public MJTopLevelMethodDeclaration[] externalMethods()
public void checkInterface(CContextType context)
throws PositionedError
checkInterface in interface JTypeDeclarationTypecheckInterface in class JClassDeclarationcontext - the context in which this
decl appears
PositionedError - an error with reference to the
source file
public void resolveSpecializers(CContextType context)
throws PositionedError
resolveSpecializers in interface JTypeDeclarationTyperesolveSpecializers in class JClassDeclarationcontext - the context in which this class
declaration appears
PositionedError - if the check fails public void resolveExtMethods(CContextType context)
resolveExtMethods in class JTypeDeclaration
public void resolveTopMethods()
throws PositionedError
resolveTopMethods in interface JTypeDeclarationTyperesolveTopMethods in class JTypeDeclarationPositionedErrorprotected CWarning uniqueSourceWarning()
uniqueSourceWarning in class JTypeDeclaration
public void typecheck(CContextType context)
throws PositionedError
typecheck in interface JTypeDeclarationTypetypecheck in class JClassDeclarationcontext - the context in which this type declaration appears
PositionedError - if any checks fail public Object clone()
clone in class Objectprotected String methodIdent()
ident() as that value represents the name of the
anchor class for the generic function.
JTypeDeclaration.ident()public void accept(MjcVisitor v)
accept in interface JMemberDeclarationTypeaccept in class JClassDeclarationv - the visitorprotected JMethodDeclarationType[] methodsToBeWrapped()
methodsToBeWrapped in class JTypeDeclarationJTypeDeclarationType.translateMJ(CContextType)
|
JML | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||