|
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.jmlspecs.checker.JmlNode
org.jmlspecs.checker.JmlMemberDeclaration
org.jmlspecs.checker.JmlMethodDeclaration
JmlMethodDeclaration.java
| Nested Class Summary |
| Nested classes inherited from class org.jmlspecs.checker.JmlNode |
JmlNode.DummyInitializerDeclaration |
| Field Summary | |
private JExpression[] |
accessedFields
|
private JmlAssignableFieldSet |
assignableFieldSet
|
private JExpression[] |
assignedFields
|
private JExpression[] |
calledMethods
|
private JmlMethodSpecification |
combinedMethodSpecification
|
private JMethodDeclaration |
delegee
|
private JmlMethodSpecification |
methodSpecification
|
private JmlAssignableFieldSet |
minAssignableFieldSet
|
private int |
modifiers2
|
private CMethodSet |
overriddenMethodSet
|
private String |
thisStringRep
|
| Fields inherited from class org.jmlspecs.checker.JmlMemberDeclaration |
refinedDecl, refiningDecl |
| Fields inherited from class org.jmlspecs.checker.JmlNode |
MJCVISIT_MESSAGE |
| 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 |
| Fields inherited from interface org.multijava.mjc.Constants |
ACC_PURE, AMID_JAVA_MATH, AMID_MAX, AMID_SAFE_MATH, CMP_VERSION, JAV_ASSERTION_ERROR, JAV_CLASS, JAV_CLASSLOADER, JAV_CLASSNOTFOUND_EXCEPTION, JAV_CLONE, JAV_CLONEABLE, JAV_CONSTRUCTOR, JAV_ERROR, JAV_EXCEPTION, JAV_INIT, JAV_LENGTH, JAV_NAME_SEPARATOR, JAV_NOCLASSDEFFOUND_ERROR, JAV_OBJECT, JAV_OUTER_THIS, JAV_RMJ_RUNTIME_EXCEPTION, JAV_RUNTIME, JAV_RUNTIME_EXCEPTION, JAV_SERIALIZABLE, JAV_STATIC_INIT, JAV_STRING, JAV_STRINGBUFFER, JAV_SUPER, JAV_THIS, JAV_THROWABLE, MJ_ANCHOR, OPE_BAND, OPE_BNOT, OPE_BOR, OPE_BSR, OPE_BXOR, OPE_EQ, OPE_GE, OPE_GT, OPE_LAND, OPE_LE, OPE_LNOT, OPE_LOR, OPE_LT, OPE_MINUS, OPE_NE, OPE_PERCENT, OPE_PLUS, OPE_POSTDEC, OPE_POSTINC, OPE_PREDEC, OPE_PREINC, OPE_SIMPLE, OPE_SL, OPE_SLASH, OPE_SR, OPE_STAR, TID_ARRAY, TID_BOOLEAN, TID_BYTE, TID_CHAR, TID_CLASS, TID_DOUBLE, TID_FLOAT, TID_INT, TID_LONG, TID_MAX, TID_SHORT, TID_VOID, UNIV_ARRAY_TMP, UNIV_TMP |
| Constructor Summary | |
protected |
JmlMethodDeclaration(TokenReference where,
JmlMethodSpecification methodSpecification,
JMethodDeclaration delegee)
|
| Method Summary | |
void |
accept(MjcVisitor p)
Accepts the specified visitor. |
void |
acceptDelegee(MjcVisitor p)
|
void |
addParameter(JFormalParameter param)
Adds an additional formal parameter to this method, appending it to the end of the existing parameter list. |
JBlock |
body()
WMD TODO remove WMD TODO remove |
void |
checkAssignableFields(JmlDataGroupMemberMap dataGroupMap)
|
CMember |
checkInterface(CContextType context)
Checks the basic interfaces to make sure things generally look OK. |
CSourceMethod |
checkInterfaceType(CContextType context,
MemberAccess access,
String ident)
Performs the interface checks that are common to all sorts of methods. |
private void |
checkMethodSpecification(CClassContextType cContext,
JmlSourceMethod self)
|
void |
checkOverriding(CContextType context,
CMethodSet superMethods)
Checks that this method appropriately overrides the given superclass methods. |
void |
checkRefinementConsistency(CContextType context)
|
void |
combineSpecifications()
|
int |
compareTo(Object o)
Compares this method to a given method and returns 0 if the methods belong to the same generic function, otherwise returns -1 or +1 to sort the methods. |
CMethodContextType |
createSelfContext(CClassContextType parent)
Creates a context for this method declaration AST node. |
JmlMethodDeclaration |
findDeclWithBody()
Returns the method declaration in the refinement chain that has a body. |
void |
genCode(CodeSequence code)
Generates a sequence of bytecodes |
JmlAssignableFieldSet |
getAssignableFieldSet()
Returns the maximal set of fields that can be assigned to by this method (takes the union of the assignable clauses from all specification cases). |
JmlMethodSpecification |
getCombinedSpecification()
Returns the method specifications of this member declaration combined with the specifications of those it refines. |
CClassType[] |
getExceptions()
|
JmlAssignableFieldSet |
getMinAssignableFieldSet(JmlDataGroupMemberMap dataGroupMap)
Returns the minimal set of fields that can be assigned to by this method (takes the intersection of the assignable clauses from the specification cases). |
boolean |
hasBody()
Indicates whether this method declaration has a body. |
boolean |
hasSpecification()
Indicates whether the method declaration represented by this has an explicit specification. |
String |
ident()
|
boolean |
isAbstract()
Returns true if this method is a abstract method. |
boolean |
isConstructor()
Returns true if this method is a constructor. |
boolean |
isExecutableModel()
Returns true if this method is a model method and can be executed by simply commenting out annotation markers. |
boolean |
isExternal()
Indicates whether this member is external. |
boolean |
isFinalizer()
Returns true if this method is a finalizer. |
boolean |
isHelper()
Returns true if this method is a helper. |
boolean |
isModel()
Returns true if this method is a model method. |
boolean |
isNative()
Returns true if this method is a native method. |
boolean |
isOverriding()
Return true if this method declaration overrides
any of its superclass (or interfaces) method declarations. |
boolean |
isPrivate()
Returns true if this method is a private method. |
boolean |
isPublic()
Returns true if this method is a public method. |
boolean |
isRacMethod()
Returns true if this method is a RAC method. |
boolean |
isSpecProtected()
Returns true if this method is spec_protected. |
boolean |
isSpecPublic()
Returns true if this method is spec_public. |
boolean |
isStatic()
Returns true if this method is a static method. |
JmlMemberAccess |
jmlAccess()
|
void |
jmlchecks(CContextType context,
JmlSourceMethod self)
|
static JmlMethodDeclaration |
makeInstance(TokenReference where,
long modifiers,
CType returnType,
String ident,
JFormalParameter[] parameters,
CClassType[] exceptions,
JBlock body,
JavadocComment javadoc,
JavaStyleComment[] comments,
JmlMethodSpecification methodSpecification)
|
JmlMethodSpecification |
methodSpecification()
|
long |
modifiers()
|
int |
modifiers2()
|
CMethodSet |
overriddenMethods()
Return the set of methods that are directly overriden (specialized) by this method declaration. |
JFormalParameter[] |
parameters()
|
protected void |
resetFinalFieldStatusIfConstructor(CClassContextType context)
Resets the final field definite assignment info if this is a constructor. |
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. |
CType |
returnType()
Returns the return type of this method declaration. |
void |
setBody(JBlock body)
Set the body of this method. |
void |
setIdent(String name)
Set the name of this method; used by RAC. |
void |
setModifiers(long modifiers)
Sets the modifiers of this method declaration |
void |
setModifiers2(int modifiers2)
Sets the modifiers2 of this method declaration |
void |
setParameters(JFormalParameter[] parameters)
|
protected void |
setRefinementLinks()
Calculates and returns the method refined by this method. |
protected void |
setRefiningMethod(JmlMethodDeclaration refiningMethod)
|
void |
setSpecstoCombinedSpecs()
|
String |
stringRepresentation()
|
void |
typecheck(CContextType context)
Typechecks this method declaration. |
boolean |
usesMultipleDispatch()
Indicates whether this method uses multiple dispatch |
| Methods inherited from class org.jmlspecs.checker.JmlMemberDeclaration |
checkRefinedModifiers, findJavaFileInRefinement, genComments, getCClass, getCombinedVarAssertions, getField, getMethod, getMostRefined, getRefinedMember, getRefiningMember, inBinaryClassFile, inJavaFile, inners, isDeprecated, isRefined, isRefiningMember, javadocComment, setRefinedMember, setRefiningMember |
| Methods inherited from class org.jmlspecs.checker.JmlNode |
enterSpecScope, enterSpecScope, exitSpecScope, exitSpecScope, privacy, privacyString |
| 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.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 |
| Field Detail |
private JMethodDeclaration delegee
private JmlMethodSpecification methodSpecification
private CMethodSet overriddenMethodSet
private JmlMethodSpecification combinedMethodSpecification
private JmlAssignableFieldSet assignableFieldSet
private JmlAssignableFieldSet minAssignableFieldSet
private JExpression[] assignedFields
private JExpression[] accessedFields
private JExpression[] calledMethods
private String thisStringRep
private int modifiers2
| Constructor Detail |
protected JmlMethodDeclaration(TokenReference where,
JmlMethodSpecification methodSpecification,
JMethodDeclaration delegee)
| Method Detail |
public static JmlMethodDeclaration makeInstance(TokenReference where,
long modifiers,
CType returnType,
String ident,
JFormalParameter[] parameters,
CClassType[] exceptions,
JBlock body,
JavadocComment javadoc,
JavaStyleComment[] comments,
JmlMethodSpecification methodSpecification)
public boolean hasBody()
hasBody in interface JMethodDeclarationTypepublic JmlMethodDeclaration findDeclWithBody()
public boolean hasSpecification()
public JmlMethodSpecification methodSpecification()
public JFormalParameter[] parameters()
parameters in interface JMethodDeclarationTypepublic void setParameters(JFormalParameter[] parameters)
setParameters in interface JMethodDeclarationTypepublic void addParameter(JFormalParameter param)
also requires param != null;
addParameter in interface JMethodDeclarationTypepublic String ident()
ident in interface JMethodDeclarationTypepublic CType returnType()
returnType in interface JMethodDeclarationTypepublic CClassType[] getExceptions()
getExceptions in interface JMethodDeclarationTypepublic long modifiers()
modifiers in interface JMethodDeclarationTypepublic void setModifiers(long modifiers)
setModifiers in interface JMethodDeclarationTypepublic boolean isHelper()
public boolean isAbstract()
public boolean isStatic()
public boolean isSpecPublic()
public boolean isSpecProtected()
public boolean isPublic()
public boolean isPrivate()
public boolean isNative()
public boolean isModel()
public boolean isConstructor()
public boolean isFinalizer()
public boolean isExecutableModel()
public JBlock body()
JMethodDeclarationType
body in interface JMethodDeclarationTypepublic void setIdent(String name)
public void setBody(JBlock body)
public boolean isOverriding()
true if this method declaration overrides
any of its superclass (or interfaces) method declarations.
isOverriding in interface JMethodDeclarationTypepublic CMethodSet overriddenMethods()
overriddenMethods in interface JMethodDeclarationTypepublic boolean usesMultipleDispatch()
usesMultipleDispatch in interface JMethodDeclarationType
public int compareTo(Object o)
throws ClassCastException
compareTo in interface JMethodDeclarationTypeo - the object to be compared against, must be a
JMethodDeclarationType
ClassCastException - if o is not an instance of
CType public boolean isExternal()
isExternal in interface JMethodDeclarationTypepublic JmlMemberAccess jmlAccess()
public CMember checkInterface(CContextType context)
throws PositionedError
checkInterface in interface JMethodDeclarationTypePositionedError - an error with reference to the
source file
public CSourceMethod checkInterfaceType(CContextType context,
MemberAccess access,
String ident)
throws PositionedError
checkInterfaceType in interface JMethodDeclarationTypecontext - the context in which this method appearsaccess - the member access for this method ident - the method name (passed as a parameter
instead of using the field to properly
handle constructors where the field is
the class name but ident is <init>
PositionedError - an error with reference to the
source filepublic void resolveExtMethods(CContextType context)
JMethodDeclarationType
resolveExtMethods in interface JMethodDeclarationType
public void resolveTopMethods()
throws PositionedError
resolveTopMethods in interface JMethodDeclarationTypePositionedErrorpublic CMethodContextType createSelfContext(CClassContextType parent)
createSelfContext in interface JMethodDeclarationTypeparent - the parent context
public void resolveSpecializers(CContextType context)
throws PositionedError
resolveSpecializers in interface JMethodDeclarationTypecontext - the context in which this class
declaration appears
PositionedError - if the check fails
public void typecheck(CContextType context)
throws PositionedError
typecheck in interface JMethodDeclarationTypecontext - the context in which this method appears
PositionedError - if the checks fail and the failure
cannot be recovered from
private void checkMethodSpecification(CClassContextType cContext,
JmlSourceMethod self)
throws PositionedError
PositionedErrorpublic void genCode(CodeSequence code)
code - the code listprotected void resetFinalFieldStatusIfConstructor(CClassContextType context)
public void jmlchecks(CContextType context,
JmlSourceMethod self)
throws PositionedError
PositionedErrorpublic JmlAssignableFieldSet getAssignableFieldSet()
public JmlAssignableFieldSet getMinAssignableFieldSet(JmlDataGroupMemberMap dataGroupMap)
public void checkAssignableFields(JmlDataGroupMemberMap dataGroupMap)
public void checkOverriding(CContextType context,
CMethodSet superMethods)
throws PositionedError
checkOverriding in interface JMethodDeclarationTypecontext - the context in which this appearssuperMethods - the super type methods that this
may override
PositionedError - if a check fails public void accept(MjcVisitor p)
accept in interface JMemberDeclarationTypeaccept in class JmlMemberDeclarationp - the visitorpublic void acceptDelegee(MjcVisitor p)
public String stringRepresentation()
stringRepresentation in class JmlMemberDeclarationprotected void setRefinementLinks()
#getRefinedMember().
Also sets the refining method of the method returned
so they are linked to each other.
protected void setRefiningMethod(JmlMethodDeclaration refiningMethod)
public void checkRefinementConsistency(CContextType context)
throws PositionedError
PositionedErrorpublic void setSpecstoCombinedSpecs()
public JmlMethodSpecification getCombinedSpecification()
getCombinedSpecification in class JmlMemberDeclarationpublic void combineSpecifications()
JmlMemberDeclaration
public void setModifiers2(int modifiers2)
public int modifiers2()
public boolean isRacMethod()
|
JML | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||