|
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.JMethodDeclaration
org.jmlspecs.checker.JMethodDeclarationWrapper
A class representing a method declaration in the syntax tree.
This class provides JML-specific handling of method declarations
by overriding several inherited methods.
For example, the makeMethodSignature method
now creates and returns an object of JmlSourceMethod instead of
CSourceMethod, that can handle JML-specific behaviors
(e.g., spec_public-ness).
| Field Summary |
| Fields inherited from class org.multijava.mjc.JMethodDeclaration |
typevariables |
| 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 |
| 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 | |
JMethodDeclarationWrapper(TokenReference where,
long modifiers,
CType returnType,
String ident,
JFormalParameter[] parameters,
CClassType[] exceptions,
JBlock body,
JavadocComment javadoc,
JavaStyleComment[] comments)
Construct a node in the parsing tree This method is directly called by the parser |
|
| Method Summary | |
void |
checkOverriding(CContextType context,
CMethodSet superMethods)
Checks that this method appropriately overrides the given superclass methods. |
boolean |
isModel()
Returns true iff this method is abstract or is a model method. |
protected MemberAccess |
makeMemberAccess(CContextType context,
CClass owner)
|
protected CSourceMethod |
makeMethodSignature(CContextType context,
MemberAccess access,
String ident,
CSpecializedType[] parameterTypes)
Generates the signature object for this method declaration. |
protected boolean |
noBodyOK(CContextType context,
CMethod self)
|
void |
typecheck(CContextType context)
Typechecks this method declaration. |
| Methods inherited from class org.multijava.mjc.JMethodDeclaration |
accept, addBridge, addParameter, body, checkInterface, checkInterfaceType, compareTo, createExtendedClassContext, createSelfContext, genCode, getExceptions, hasBody, ident, isExternal, isOverriding, modifiers, overriddenMethods, parameters, resolveExtMethods, resolveSpecializers, resolveTopMethods, returnType, setBody, setIdent, setModifiers, setParameters, toString, usesMultipleDispatch |
| 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, 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 |
| Constructor Detail |
public JMethodDeclarationWrapper(TokenReference where,
long modifiers,
CType returnType,
String ident,
JFormalParameter[] parameters,
CClassType[] exceptions,
JBlock body,
JavadocComment javadoc,
JavaStyleComment[] comments)
where - the line of this node in the source codemodifiers - list of modifiersreturnType - the return type of this methodident - the name of this methodparameters - the parameters of this methodexceptions - the exceptions throw by this methodbody - the body of this methodjavadoc - javadoc comments, including whether this
method is deprecatedcomments - regular java style comments| Method Detail |
protected CSourceMethod makeMethodSignature(CContextType context,
MemberAccess access,
String ident,
CSpecializedType[] parameterTypes)
JmlSourceMethod.
makeMethodSignature in class JMethodDeclaration
protected MemberAccess makeMemberAccess(CContextType context,
CClass owner)
makeMemberAccess in class JMethodDeclarationpublic boolean isModel()
protected boolean noBodyOK(CContextType context,
CMethod self)
noBodyOK in class JMethodDeclaration
public void checkOverriding(CContextType context,
CMethodSet superMethods)
throws PositionedError
also requires context != null && superMethods != null;
checkOverriding in interface JMethodDeclarationTypecheckOverriding in class JMethodDeclarationcontext - the context in which this appearssuperMethods - the super types methods that this
may override.
PositionedError - if a check fails
public void typecheck(CContextType context)
throws PositionedError
JMethodDeclaration
typecheck in interface JMethodDeclarationTypetypecheck in class JMethodDeclarationcontext - the context in which this method appears
PositionedError - if the checks fail and the failure
cannot be recovered from
|
JML | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||