|
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.JmlMethodName
This AST node represents a method name in a JML annotation. The syntax for the method name is defined as follows.
method-name ::= method-ref [ "(" [ param-disambig-list ] ")" ]
method-ref ::= method-ref-start [ "." ident ] ...
| "new" reference-type
method-ref-start := "super" | "this" | ident | "\other"
param-disambig-list ::= param-disambig [ "," param-disambig ] ...
param-disambig ::= type-spec [ ident [ dims ]]
| Nested Class Summary |
| Nested classes inherited from class org.jmlspecs.checker.JmlNode |
JmlNode.DummyInitializerDeclaration |
| Field Summary | |
protected JExpression[] |
args
Internally used for typechecking |
protected CMethod |
method
The method call specified, as determined by the static receiver and argument types. |
protected JmlName |
methodName
|
protected CType[] |
paramDisambigList
An array of the parameter types, used to disambiguate between overloaded methods. |
protected JExpression |
prefix
|
protected String |
stringRepresentation
Internally used |
protected JmlName[] |
subnames
The name of the method as given in the source code. |
| 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 | |
|
JmlMethodName(TokenReference where,
JmlName[] subnames,
CType[] paramDisambigList)
|
protected |
JmlMethodName(TokenReference where,
CType[] paramDisambigList)
|
| Method Summary | |
void |
accept(MjcVisitor p)
Accepts the specified visitor. |
private void |
buildPrefix()
Compose the subnames into a prefix expression separated from the method name for typechecking purposes. |
private void |
checkForExactArgumentTypes(CFlowControlContextType context)
|
private JExpression |
defaultValue(CType type)
Return the default value for type; used for typechecking. |
String |
getPrefixName()
Returns a String representation of the prefix to the method, i.e., the receiver expression, used for creating error messages. |
boolean |
hasParamDisambigList()
Indicates if this method name has a list of parameter types specified. |
protected CMethod |
lookupMethod(CType[] argTypes,
CExpressionContextType context)
|
CType[] |
paramDisambigList()
|
JmlName[] |
subnames()
Returns the subname part of this method name. |
String |
toString()
|
void |
typecheck(CFlowControlContextType context,
long privacy,
boolean checkPurity)
Typechecks this method name in the context in which it appears. |
| 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, wait, wait, wait |
| Field Detail |
protected JmlName[] subnames
protected JExpression prefix
protected JmlName methodName
protected CType[] paramDisambigList
protected JExpression[] args
protected String stringRepresentation
protected CMethod method
| Constructor Detail |
public JmlMethodName(TokenReference where,
JmlName[] subnames,
CType[] paramDisambigList)
protected JmlMethodName(TokenReference where,
CType[] paramDisambigList)
| Method Detail |
public JmlName[] subnames()
public CType[] paramDisambigList()
public boolean hasParamDisambigList()
public String toString()
toString in class Object
protected CMethod lookupMethod(CType[] argTypes,
CExpressionContextType context)
throws UnpositionedError,
PositionedError
UnpositionedError
PositionedErrorpublic String getPrefixName()
public void typecheck(CFlowControlContextType context,
long privacy,
boolean checkPurity)
throws PositionedError
checkPurity is true.
context - the context in which this appearsprivacy - the visibility level with which to typecheck
PositionedError - if any checks fail private void checkForExactArgumentTypes(CFlowControlContextType context)
private JExpression defaultValue(CType type)
private void buildPrefix()
public void accept(MjcVisitor p)
accept in class JmlNodep - the visitor
|
JML | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||