|
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.JmlSpecCase
org.jmlspecs.checker.JmlGeneralSpecCase
An abstraction of JML specification cases. JML supports several kinds of specification cases, and this abstract class is the common superclass of different kinds of specification cases such as normal, exceptional, and generic (i.e., JmlExceptionalSpecCase, JmlNormalSpecCase, and JmlGenericSpecCase). A particular kind of specification case has the following form of production rule:
X-spec-case :: = [ spec-var-decls ] spec-header [ X-spec-body ]
| [ spec-var-decls ] X-spec-body
where X can be generic, normal, and
exceptional.
| Nested Class Summary |
| Nested classes inherited from class org.jmlspecs.checker.JmlNode |
JmlNode.DummyInitializerDeclaration |
| Field Summary | |
protected JmlAssignableFieldSet |
assignableFieldSet
|
protected JmlAssignableFieldSet |
minAssignableFieldSet
|
protected JmlSpecBody |
specBody
|
protected JmlRequiresClause[] |
specHeader
|
protected JmlSpecVarDecl[] |
specVarDecls
|
| Fields inherited from class org.jmlspecs.checker.JmlNode |
MJCVISIT_MESSAGE |
| 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 | |
protected |
JmlGeneralSpecCase(TokenReference where,
JmlSpecVarDecl[] specVarDecls,
JmlRequiresClause[] specHeader,
JmlSpecBody specBody)
Creates a new JmlGeneralSpecCase instance. |
| Method Summary | |
void |
accept(MjcVisitor m)
Throws an UnsupportedOperationException since an MjcVisitor cannot be used to visit a JML AST. |
void |
addRequiresClause(JmlRequiresClause req)
Add the given requires clause to this specification case. |
JmlAssignableFieldSet |
getAssignableFieldSet(JmlSourceMethod method)
Returns the maximal set of fields that can be assigned to by the given method (takes the union of the assignable clauses from all specification cases). |
JmlAssignableFieldSet |
getMinAssignableFieldSet(JmlSourceMethod method,
JmlDataGroupMemberMap dataGroupMap)
Returns the minimal set of fields that can be assigned to by the given method (takes the intersection of the assignable clauses of all specification cases). |
boolean |
hasNonRedundantAssignable()
Returns true if this general specification case has a non-redunant assignable clause. |
boolean |
hasNonRedundantEnsures()
Returns true if this general specification case has a non-redunant ensures clause. |
boolean |
hasNonRedundantRequiresClause()
Returns true if this general specification case has a non-redunant requires clause. |
boolean |
hasSpecBody()
|
boolean |
hasSpecHeader()
|
boolean |
hasSpecVarDecls()
|
protected long |
privacy(CFlowControlContextType context)
Returns the privacy of this specification case. |
JmlSpecBody |
specBody()
|
JmlRequiresClause[] |
specHeader()
|
JmlSpecVarDecl[] |
specVarDecls()
|
void |
typecheck(CFlowControlContextType context)
Typechecks this specification case in the context in which it appears. |
void |
typecheck(CFlowControlContextType context,
long privacy,
boolean isNestedSpecCase)
Typechecks this specification case with the privacy, privacy, in the context in which it
appears. |
| Methods inherited from class org.jmlspecs.checker.JmlSpecCase |
isCodeSpec |
| 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 |
| Field Detail |
protected JmlSpecVarDecl[] specVarDecls
protected JmlRequiresClause[] specHeader
protected JmlSpecBody specBody
protected JmlAssignableFieldSet assignableFieldSet
protected JmlAssignableFieldSet minAssignableFieldSet
| Constructor Detail |
protected JmlGeneralSpecCase(TokenReference where,
JmlSpecVarDecl[] specVarDecls,
JmlRequiresClause[] specHeader,
JmlSpecBody specBody)
JmlGeneralSpecCase instance.
where - a TokenReference valuespecVarDecls - an array of spec variable declarations
(JmlSpecVarDecl)specHeader - an array of requires clauses
(JmlRequiresClause)specBody - a specification body (JmlSpecBody)| Method Detail |
public JmlAssignableFieldSet getAssignableFieldSet(JmlSourceMethod method)
public JmlAssignableFieldSet getMinAssignableFieldSet(JmlSourceMethod method,
JmlDataGroupMemberMap dataGroupMap)
public JmlSpecVarDecl[] specVarDecls()
public JmlRequiresClause[] specHeader()
public JmlSpecBody specBody()
public boolean hasSpecVarDecls()
public boolean hasSpecHeader()
public boolean hasSpecBody()
public boolean hasNonRedundantAssignable()
public boolean hasNonRedundantRequiresClause()
public boolean hasNonRedundantEnsures()
public void addRequiresClause(JmlRequiresClause req)
public void accept(MjcVisitor m)
JmlNode
accept in class JmlNode
public void typecheck(CFlowControlContextType context,
long privacy,
boolean isNestedSpecCase)
throws PositionedError
privacy, in the context in which it
appears. Mutates the context to record the information learned
during checking.
requires privacy == ACC_PUBLIC || privacy == ACC_PROTECTED || privacy == ACC_PRIVATE || privacy == 0;
context - the context in which this appears
PositionedError - if any checks fail
public void typecheck(CFlowControlContextType context)
throws PositionedError
context - the context in which this appears
PositionedError - if any checks fail protected long privacy(CFlowControlContextType context)
ensures \result == ACC_PUBLIC || \result == ACC_PROTECTED || \result == ACC_PRIVATE || \result == 0;
|
JML | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||