|
JML | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.multijava.util.Utils
org.jmlspecs.jmlrac.TransUtils
org.jmlspecs.jmlrac.TransInvariant
A class for translating JML invariants. The translation produces
two invariant check methods, one for static (class)
invariants and the other for non-static (instance) invariants.
Multiple invariant clauses are conjoined and non_null
fields, if exist any, are also conjoined to the invariant clauses;
a non_null annotation for a field x is
translated into a predicate x != null. The generated
invariant check methods are returned as an object of
RacNode.
| Field Summary | |
private JmlTypeDeclaration |
typeDecl
taget type declaration that has this invariant specification. |
private VarGenerator |
varGen
variable generator to be used in the translation |
| Fields inherited from class org.jmlspecs.jmlrac.TransUtils |
|
| Fields inherited from class org.multijava.util.Utils |
DBG_LEVEL_HIGH, DBG_LEVEL_LOW, DBG_LEVEL_NO |
| Fields inherited from interface org.jmlspecs.jmlrac.RacConstants |
MN_CHECK_HC, MN_CHECK_INV, MN_CHECK_POST, MN_CHECK_PRE, MN_CHECK_XPOST, MN_EVAL_OLD, MN_GHOST, MN_INIT, MN_INTERNAL, MN_MODEL, MN_MODEL_PUBLIC, MN_RESTORE_FROM, MN_SAVE_TO, MN_SPEC, MN_SPEC_PUBLIC, TN_JMLCHECKABLE, TN_JMLSURROGATE, TN_JMLUNIT_TEST_POSTFIX, TN_JMLUNIT_TESTDATA_POSTFIX, TN_JMLVALUE, TN_SURROGATE, VN_ASSERTION, VN_CATCH_VAR, VN_CLASS_INIT, VN_CONSTRUCTED, VN_DELEGEE, VN_ERROR_SET, VN_EXCEPTION, VN_FREE_VAR, VN_INIT, VN_OLD_VAR, VN_POST_VAR, VN_PRE_VAR, VN_PRECOND, VN_RAC_COMPILED, VN_RAC_LEVEL, VN_RESULT, VN_STACK_VAR, VN_XRESULT |
| Constructor Summary | |
TransInvariant(JmlTypeDeclaration typeDecl,
VarGenerator varGen)
Constructs a TransInvariant object. |
|
| Method Summary | |
private static boolean |
isCheckable(JmlInvariant inv)
Returns true if the given invariant clause is checkable. |
RacNode |
translate(JmlInvariant[] invariants)
Generates both static and instance invariant check methods and return them. |
private RacNode |
translate(JmlInvariant[] invariants,
boolean forStatic)
Generates and returns a static or an instance invariant check method for the given invariant clauses, invariants. |
| 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 |
private final VarGenerator varGen
private final JmlTypeDeclaration typeDecl
| Constructor Detail |
public TransInvariant(JmlTypeDeclaration typeDecl,
VarGenerator varGen)
TransInvariant object.
typeDecl - host type declaration that contains the
invariant clauses to be translated.varGen - variable generator to be used in the translation
requires typeDecl != null && varGen != null;
| Method Detail |
public RacNode translate(JmlInvariant[] invariants)
invariants - Invariants to be translated
RacNode representing static and
non-static invariant check methods.
requires invariants != null; ensures \result != null;
private RacNode translate(JmlInvariant[] invariants,
boolean forStatic)
invariants. All invariants and
non_null annotations are conjoined and then
translated; a non_null annotation for a field
x is translated into x != null to be
conjoined to the invariant clauses.
invariants - Invariants to be translatedforStatic - type of invariants to be translated
(static or non-static)
RacNode representing
the invariant check method
requires invariants != null; ensures \result != null;
private static boolean isCheckable(JmlInvariant inv)
|
JML | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||