|
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.JmlDeclaration
org.jmlspecs.checker.JmlRepresentsDecl
This AST node represents a JML represents declaration annotation. The syntax for the represents declaration is as follows.
represents-decl ::= represents-keyword store-ref "<-" spec-expression ";"
| represents-keyword store-ref "=" spec-expression ";"
| represetns-keyword store-ref "\such_that" predicate ";"
represents-keyword ::= "represents" | "represents_redundantly"
| Nested Class Summary |
| Nested classes inherited from class org.jmlspecs.checker.JmlNode |
JmlNode.DummyInitializerDeclaration |
| Field Summary | |
private JmlPredicate |
predicate
|
private JmlSpecExpression |
specExpression
|
protected JmlStoreRefExpression |
storeRef
An AST for the storeRef expression of the more abstract variable in this. |
| Fields inherited from class org.jmlspecs.checker.JmlDeclaration |
modifiers, redundantly |
| 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 | |
JmlRepresentsDecl(TokenReference where,
long modifiers,
boolean redundantly,
JmlStoreRefExpression storeRef,
JmlPredicate predicate)
Creates a new JmlRepresentsDecl instance. |
|
JmlRepresentsDecl(TokenReference where,
long modifiers,
boolean redundantly,
JmlStoreRefExpression storeRef,
JmlSpecExpression specExpression)
Creates a new JmlRepresentsDecl instance. |
|
| Method Summary | |
void |
accept(MjcVisitor p)
Accepts the specified visitor. |
protected void |
checkRightHandSide(JmlExpressionContext context)
Performs type-checking of right-hand side of the represents clause. |
protected void |
checkStoreRef(JmlExpressionContext context)
Checks the store ref of this depends/represents clause. |
JmlSourceField |
getField()
Returns the JmlSourceField of the model variable that this represents clause specifies for. |
String |
ident()
Returns the identifier of the represented model field. |
protected static boolean |
isInheritedOrOuter(JClassFieldExpression field)
Returns true if the given field expression refers to a field declared in this class, inherited from a superclasse or interface, or defined in an outer class or interface. |
JmlPredicate |
predicate()
Returns the predicate of this represents declaration. |
JmlSpecExpression |
specExpression()
Returns the spec expression of this represents declaration. |
JmlStoreRefExpression |
storeRef()
Returns the store ref expression of this represents declaration. |
void |
typecheck(CContextType context)
Typechecks this depends/represents clause in the context in which it appears. |
boolean |
usesAbstractionFunction()
Indicates whether this represents declaration uses an abstraction function. |
boolean |
usesAbstractionRelation()
Indicates whether this represents declaration uses an abstraction relations. |
| Methods inherited from class org.jmlspecs.checker.JmlDeclaration |
checkModifiers, clone, createContext, createContextHelper, isRedundantly, isStatic, modifiers, privacy |
| 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 |
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected JmlStoreRefExpression storeRef
private JmlSpecExpression specExpression
private JmlPredicate predicate
| Constructor Detail |
public JmlRepresentsDecl(TokenReference where,
long modifiers,
boolean redundantly,
JmlStoreRefExpression storeRef,
JmlSpecExpression specExpression)
JmlRepresentsDecl instance.
where - a TokenReference valuemodifiers - modifier bit-maskredundantly - true ==> this is a representsDecl_redundantly
statementstoreRef - the model variable whose representation is being definedspecExpression - the abstract function that gives the value of
storeRef based on its dependees
public JmlRepresentsDecl(TokenReference where,
long modifiers,
boolean redundantly,
JmlStoreRefExpression storeRef,
JmlPredicate predicate)
JmlRepresentsDecl instance.
where - a TokenReference valuemodifiers - modifier bit-maskredundantly - true ==> this is a representsDecl_redundantly
statementstoreRef - the model variable whose representation is being definedpredicate - the abstract relation that relates the value of
storeRef to its dependees| Method Detail |
public JmlStoreRefExpression storeRef()
public JmlSpecExpression specExpression()
null
is returned.
public JmlPredicate predicate()
null
is returned.
public boolean usesAbstractionFunction()
ensures \result <==> specExpression != null;
public boolean usesAbstractionRelation()
ensures \result <==> predicate != null;
public String ident()
public JmlSourceField getField()
represents clause specifies for. This method must be
called after typechecking.
public void typecheck(CContextType context)
throws PositionedError
context - the context in which this type declaration appears
PositionedError - if any checks fail
protected void checkStoreRef(JmlExpressionContext context)
throws PositionedError
PositionedError
protected void checkRightHandSide(JmlExpressionContext context)
throws PositionedError
PositionedErrorprotected static boolean isInheritedOrOuter(JClassFieldExpression field)
public void accept(MjcVisitor p)
accept in class JmlDeclarationp - the visitor
|
JML | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||