|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jmlspecs.jml4.rac.ExpressionTranslator
org.jmlspecs.jml4.rac.PostStateExpressionTranslator
org.jmlspecs.jml4.rac.PreconditionTranslator
public class PreconditionTranslator
Translates the precondition of a method or constructor into RAC code. This class translates a precondition into a precondition check method. An object of this class should be used as follows.
#translate(AbstractMethodDeclaration,
VariableGenerator)
method to translate a precondition of
a method or constructor to RAC code. After this invocation,
the names of precondition variables become available
(see getPreconditionVariables()
); these names are
needed to generate postcondition check methods.
getPreconditionMethod(Collection, RacResult)
to creates a postcondition method.
Field Summary |
---|
Fields inherited from class org.jmlspecs.jml4.rac.ExpressionTranslator |
---|
localclassTransformation, terms |
Constructor Summary | |
---|---|
PreconditionTranslator(JmlTypeDeclaration sourceType,
VariableGenerator varGen)
Creates a new precondition translator for the given type. |
Method Summary | |
---|---|
java.util.List<RacOldExpression> |
getOldExpressions()
Return all old expressions found in the postcondition. |
MethodDeclaration |
getPreconditionMethod(java.util.Collection<RacOldExpression> oldExprs,
RacResult racResult)
Returns a precondition check method that also executes the given old expressions (in the pre-state). |
java.util.List<java.lang.String> |
getPreconditionVariables()
Returns names of boolean fields to store the truth of preconditions, one for each specification case in a method specification. |
void |
putOldExpressions(java.util.List<RacOldExpression> oldExp)
Puts old expressions found in the expression under translation. |
java.lang.String |
translate(Expression expression,
TypeBinding type,
RacResult result)
Translates the given expression of the given type. |
void |
translate(JmlMethodSpecification methSpec,
AbstractMethodDeclaration meth,
VariableGenerator vgen,
RacResult result)
Translates the precondition of the given method into RAC code. |
Methods inherited from class org.jmlspecs.jml4.rac.PostStateExpressionTranslator |
---|
getOldQuantifiedExpressions, translate |
Methods inherited from class org.jmlspecs.jml4.rac.ExpressionTranslator |
---|
embedSpecCase, getTerms, isPresent, setEvaluatorPDef, setEvaluatorPUse, translate, translate, translate, translate, translate |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public PreconditionTranslator(JmlTypeDeclaration sourceType, VariableGenerator varGen)
Method Detail |
---|
public java.util.List<java.lang.String> getPreconditionVariables()
prepareTranslation
method call.
public java.util.List<RacOldExpression> getOldExpressions()
getOldExpressions
in class PostStateExpressionTranslator
public void putOldExpressions(java.util.List<RacOldExpression> oldExp)
putOldExpressions
in class PostStateExpressionTranslator
public void translate(JmlMethodSpecification methSpec, AbstractMethodDeclaration meth, VariableGenerator vgen, RacResult result)
getPreconditionVariables()
. After this call,
the precondition method becomes available by calling
getPreconditionMethod(Collection, RacResult)
.
getPreconditionVariables()
,
getPreconditionMethod(Collection, RacResult)
public MethodDeclaration getPreconditionMethod(java.util.Collection<RacOldExpression> oldExprs, RacResult racResult)
#translate(AbstractMethodDeclaration,
VariableGenerator)
.
racResult
- TODOpublic java.lang.String translate(Expression expression, TypeBinding type, RacResult result)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |