|
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.JmlFieldDeclaration
JmlFieldDeclaration.java
| Nested Class Summary | |
(package private) class |
JmlFieldDeclaration.JmlFieldSpecsContext
A special flow control context class for typechecking JML data group clauses. |
| Nested classes inherited from class org.jmlspecs.checker.JmlNode |
JmlNode.DummyInitializerDeclaration |
| Field Summary | |
private JStatement |
assertionCode
Java source code generated by jmlrac for runtime assertion checking. |
private JmlInGroupClause[] |
combinedInGroups
|
private JmlMapsIntoClause[] |
combinedMapsIntoGroups
|
private JmlVarAssertion[] |
combinedVarAssertions
|
ArrayList |
datagroupContents
|
private JFieldDeclaration |
delegee
|
private JmlInGroupClause[] |
inGroups
|
private JmlMapsIntoClause[] |
mapsIntoGroups
|
private JmlVarAssertion[] |
varAssertions
|
| 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 |
JmlFieldDeclaration(TokenReference where,
JmlVarAssertion[] varAssertions,
JmlDataGroupAccumulator dataGroups,
JFieldDeclaration delegee)
|
| Method Summary | |
void |
accept(MjcVisitor p)
Accepts the specified visitor. |
void |
addSelfToInDataGroups(JmlSourceField self,
JmlInGroupClause inGroupClause,
JmlDataGroupMemberMap dataGroupMap)
|
void |
addToDataGroups(JmlDataGroupMemberMap dataGroupMap)
|
JStatement |
assertionCode()
Returns the Java source code generated by jmlrac for runtime assertion checking. |
void |
checkFieldSpecs(CFlowControlContextType context,
JmlSourceField self)
Typechecks the specifications associated with this field, i.e., data group specifications. |
CSourceField |
checkInterface(CClassContextType context)
Checks the basic interfaces to make sure things generally look OK. |
void |
checkRefinementConsistency(CContextType context)
|
void |
combineDataGroups(JmlFieldDeclaration refField)
|
void |
combineSpecifications()
|
JmlFieldDeclaration |
findDeclWithInitializer()
Returns the field declaration in the refinement chain that has an initializer. |
void |
genCode(CodeSequence code)
Generates a sequence of bytecodes |
JmlInGroupClause[] |
getCombinedInGroupClauses()
|
JmlMapsIntoClause[] |
getCombinedMapsIntoClauses()
|
JmlVarAssertion[] |
getCombinedVarAssertions()
Returns the variable assertions of this member declaration combined with the assertions of those it refines. |
JExpression |
getInitializer()
|
CType |
getType()
Returns the type of this field |
boolean |
hasAssertionCode()
Returns true if this field declaration has the
Java source code generated by jmlrac. |
boolean |
hasAssertions()
Indicates whether this field declaration has an accompanying jml-var-assertion. |
boolean |
hasInitializer()
Returns true if this field declarator has an initializer (should be initialized) |
String |
ident()
Returns the identifier of this field declaration |
JmlInGroupClause[] |
inGroupClauses()
|
boolean |
isModel()
Returns true if this member is declared with a 'model' modifier. |
JmlMemberAccess |
jmlAccess()
|
static JmlFieldDeclaration |
makeInstance(TokenReference where,
JVariableDefinition var,
JavadocComment javadoc,
JavaStyleComment[] comment,
JmlVarAssertion[] varAssertions,
JmlDataGroupAccumulator dataGroups)
|
JmlMapsIntoClause[] |
mapsIntoClauses()
|
long |
modifiers()
Returns the modifiers of this field declaration |
boolean |
needInitialization()
Returns true if this field need to be initialized WARNING: this method returns true when initial value corresponds to a default value ====> a second check should be made after typecheck to ensure that an initialization is really needed |
void |
setAssertionCode(JStatement code)
Sets the Java source code generated by jmlrac for runtime assertion checking. |
void |
setInitializer(JExpression expr)
Sets the initialization expression for this field. |
void |
setModifiers(long mod)
Set the modifiers of this field declaration. |
protected void |
setRefinementLinks()
Determines the field refined by this field (if there is one). |
protected void |
setRefiningField(JmlFieldDeclaration refiningField)
|
void |
setSpecstoCombinedSpecs()
|
void |
typecheck(CFlowControlContextType context)
Checks whether this field declaration includes a field initializer and mutates the context to store this information about the field. |
JmlVarAssertion[] |
varAssertions()
Returns the jml-var-assertion associated with this. |
JVariableDefinition |
variable()
|
| Methods inherited from class org.jmlspecs.checker.JmlMemberDeclaration |
checkRefinedModifiers, findJavaFileInRefinement, genComments, getCClass, getCombinedSpecification, getField, getMethod, getMostRefined, getRefinedMember, getRefiningMember, inBinaryClassFile, inJavaFile, inners, isDeprecated, isRefined, isRefiningMember, javadocComment, setRefinedMember, setRefiningMember, stringRepresentation |
| 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 JmlVarAssertion[] varAssertions
private JmlVarAssertion[] combinedVarAssertions
private JmlInGroupClause[] inGroups
private JmlInGroupClause[] combinedInGroups
private JmlMapsIntoClause[] mapsIntoGroups
private JmlMapsIntoClause[] combinedMapsIntoGroups
public ArrayList datagroupContents
private JFieldDeclaration delegee
private JStatement assertionCode
| Constructor Detail |
protected JmlFieldDeclaration(TokenReference where,
JmlVarAssertion[] varAssertions,
JmlDataGroupAccumulator dataGroups,
JFieldDeclaration delegee)
| Method Detail |
public static JmlFieldDeclaration makeInstance(TokenReference where,
JVariableDefinition var,
JavadocComment javadoc,
JavaStyleComment[] comment,
JmlVarAssertion[] varAssertions,
JmlDataGroupAccumulator dataGroups)
public boolean hasAssertions()
ensures \result <==> varAssertions != null && varAssertions.length > 0;
public JmlVarAssertion[] varAssertions()
requires hasAssertions();
public boolean hasInitializer()
hasInitializer in interface JFieldDeclarationTypepublic JExpression getInitializer()
public void setInitializer(JExpression expr)
public JmlFieldDeclaration findDeclWithInitializer()
public CType getType()
getType in interface JFieldDeclarationTypepublic boolean needInitialization()
needInitialization in interface JFieldDeclarationTypepublic JVariableDefinition variable()
variable in interface JFieldDeclarationTypepublic long modifiers()
modifiers in interface JFieldDeclarationTypepublic void setModifiers(long mod)
public String ident()
ident in interface JFieldDeclarationTypepublic JStatement assertionCode()
public boolean hasAssertionCode()
true if this field declaration has the
Java source code generated by jmlrac. E.g., initialzer for
ghost variables.
public void setAssertionCode(JStatement code)
public JmlMemberAccess jmlAccess()
public boolean isModel()
public CSourceField checkInterface(CClassContextType context)
throws PositionedError
checkInterface in interface JFieldDeclarationTypecontext - the context in which this field appears
PositionedError - an error with reference to the source file
public void typecheck(CFlowControlContextType context)
throws PositionedError
typecheck in interface JFieldDeclarationTypecontext - the context in which this field is declared
PositionedError - if any checks fail
public void checkFieldSpecs(CFlowControlContextType context,
JmlSourceField self)
throws PositionedError
context - the context in which this field is declared
PositionedError - if any checks fail public void genCode(CodeSequence code)
genCode in interface JFieldDeclarationTypecode - the code listpublic void accept(MjcVisitor p)
accept in interface JMemberDeclarationTypeaccept in class JmlMemberDeclarationp - the visitor
public void checkRefinementConsistency(CContextType context)
throws PositionedError
PositionedErrorprotected void setRefinementLinks()
#getRefinedMember().
Also links the refined field back to this,
so they are linked to each other.
protected void setRefiningField(JmlFieldDeclaration refiningField)
public void setSpecstoCombinedSpecs()
public JmlVarAssertion[] getCombinedVarAssertions()
getCombinedVarAssertions in class JmlMemberDeclarationpublic void combineSpecifications()
JmlMemberDeclaration
public void combineDataGroups(JmlFieldDeclaration refField)
public JmlInGroupClause[] inGroupClauses()
public JmlInGroupClause[] getCombinedInGroupClauses()
public JmlMapsIntoClause[] mapsIntoClauses()
public JmlMapsIntoClause[] getCombinedMapsIntoClauses()
public void addToDataGroups(JmlDataGroupMemberMap dataGroupMap)
public void addSelfToInDataGroups(JmlSourceField self,
JmlInGroupClause inGroupClause,
JmlDataGroupMemberMap dataGroupMap)
|
JML | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||