|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.jdt.internal.compiler.ASTVisitor
org.jmlspecs.jml4.rac.InlineAssertionVisitor
public class InlineAssertionVisitor
Visitor class to translate a JML in-line assertion into RAC code.
Developer's note: The node of translated RAC code is later
merged to the node of its in-line assertion during the AST merging
phase. For this, this class works in a close collaboration with
the InlineAssertionMerger
. Thus, when a new JML in-line
assertion is supported for RAC, both classes should be reviewed;
in particular, the @{link isRacInlineAssertion(Statement)
}
should be revised to include the newly supported in-line assertion;
this method is used by the merger class. In general, it requires
two steps:
isRacInlineAssertion(Statement)
method
to state that the new in-line assertion is RAC-compiled.
Constructor Summary | |
---|---|
InlineAssertionVisitor()
Creates a new translator. |
Method Summary | |
---|---|
void |
checkJmlStatement(JmlSetStatement stmt)
|
void |
endVisit(Block block,
BlockScope scope)
Overridden Visitor methods to keep track of inline statements that are not embedded inside blocks. |
void |
endVisit(DoStatement doStatement,
BlockScope scope)
|
void |
endVisit(ForeachStatement forStatement,
BlockScope scope)
|
void |
endVisit(ForStatement forStatement,
BlockScope scope)
|
void |
endVisit(IfStatement ifStatement,
BlockScope scope)
|
void |
endVisit(JmlDoStatement doStatement,
BlockScope scope)
|
void |
endVisit(JmlForeachStatement jmlforeachStatement,
BlockScope scope)
|
void |
endVisit(JmlForStatement forStatement,
BlockScope scope)
|
void |
endVisit(JmlWhileStatement jmlwhileStatement,
BlockScope scope)
|
void |
endVisit(LabeledStatement labeledStatement,
BlockScope scope)
|
void |
endVisit(WhileStatement whileStatement,
BlockScope scope)
|
static boolean |
isLoopAnnotated(Statement stmt)
|
static boolean |
isRacInlineAssertion(Statement stmt)
Return true if the given statement is a JML in-line assertion and currently supported for RAC. |
java.lang.StringBuffer |
translate(AbstractMethodDeclaration meth,
RacResult result)
Translates all in-line assertions contained in the body of the given method to RAC code in the AST visitor traversal order and return the translated RAC code. |
java.lang.StringBuffer |
translate(Initializer initBlock,
RacResult result)
Translates all jml-assertion statements in Initializer blocks. |
java.lang.StringBuffer |
translate(Statement stmt,
AbstractMethodDeclaration meth,
RacResult result)
Translates the given (in-line assertion) statement in the context of the given method and returns the translated RAC code. |
boolean |
visit(Block block,
BlockScope scope)
|
boolean |
visit(DoStatement doStatement,
BlockScope scope)
|
boolean |
visit(ForeachStatement forStatement,
BlockScope scope)
|
boolean |
visit(ForStatement forStatement,
BlockScope scope)
|
boolean |
visit(IfStatement ifStatement,
BlockScope scope)
|
boolean |
visit(JmlAssertStatement stmt,
BlockScope scope)
Overridden here to visit and translate the given JML assert statement into RAC code. |
boolean |
visit(JmlAssumeStatement stmt,
BlockScope scope)
Overridden here to visit and translate the given JML assume statement into RAC code. |
boolean |
visit(JmlDoStatement doStatement,
BlockScope scope)
|
boolean |
visit(JmlForeachStatement foeachStatement,
BlockScope scope)
|
boolean |
visit(JmlForStatement forStatement,
BlockScope scope)
|
boolean |
visit(JmlSetStatement stmt,
BlockScope scope)
Overridden here to visit and translate the given JML set statement into RAC code. |
boolean |
visit(JmlWhileStatement whileStatement,
BlockScope scope)
|
boolean |
visit(LabeledStatement labeledStatement,
BlockScope scope)
|
boolean |
visit(WhileStatement whileStatement,
BlockScope scope)
|
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public InlineAssertionVisitor()
Method Detail |
---|
public java.lang.StringBuffer translate(AbstractMethodDeclaration meth, RacResult result)
result
.
public java.lang.StringBuffer translate(Initializer initBlock, RacResult result)
translateMethod
public static boolean isRacInlineAssertion(Statement stmt)
This method is used by InlineAssertionMerger
to
merge the translated RAC code to its original in-line assertion.
Thus, it has to be revised whenever a new JML in-line assertion
becomes supported for RAC.
public java.lang.StringBuffer translate(Statement stmt, AbstractMethodDeclaration meth, RacResult result)
public boolean visit(JmlAssertStatement stmt, BlockScope scope)
visit
in class ASTVisitor
public boolean visit(JmlAssumeStatement stmt, BlockScope scope)
visit
in class ASTVisitor
public boolean visit(JmlSetStatement stmt, BlockScope scope)
visit
in class ASTVisitor
public void checkJmlStatement(JmlSetStatement stmt)
public boolean visit(JmlWhileStatement whileStatement, BlockScope scope)
visit
in class ASTVisitor
public boolean visit(JmlDoStatement doStatement, BlockScope scope)
visit
in class ASTVisitor
public boolean visit(JmlForStatement forStatement, BlockScope scope)
visit
in class ASTVisitor
public boolean visit(JmlForeachStatement foeachStatement, BlockScope scope)
visit
in class ASTVisitor
public static boolean isLoopAnnotated(Statement stmt)
public void endVisit(Block block, BlockScope scope)
Such examples can be associated with if, if-else, if-elseif, while, for, do-while statements.if (C)
endVisit
in class ASTVisitor
public boolean visit(Block block, BlockScope scope)
visit
in class ASTVisitor
public void endVisit(JmlWhileStatement jmlwhileStatement, BlockScope scope)
endVisit
in class ASTVisitor
public void endVisit(JmlForeachStatement jmlforeachStatement, BlockScope scope)
endVisit
in class ASTVisitor
public void endVisit(JmlDoStatement doStatement, BlockScope scope)
endVisit
in class ASTVisitor
public void endVisit(JmlForStatement forStatement, BlockScope scope)
endVisit
in class ASTVisitor
public boolean visit(DoStatement doStatement, BlockScope scope)
visit
in class ASTVisitor
public void endVisit(DoStatement doStatement, BlockScope scope)
endVisit
in class ASTVisitor
public boolean visit(ForeachStatement forStatement, BlockScope scope)
visit
in class ASTVisitor
public void endVisit(ForeachStatement forStatement, BlockScope scope)
endVisit
in class ASTVisitor
public boolean visit(ForStatement forStatement, BlockScope scope)
visit
in class ASTVisitor
public void endVisit(ForStatement forStatement, BlockScope scope)
endVisit
in class ASTVisitor
public boolean visit(IfStatement ifStatement, BlockScope scope)
visit
in class ASTVisitor
public void endVisit(IfStatement ifStatement, BlockScope scope)
endVisit
in class ASTVisitor
public boolean visit(WhileStatement whileStatement, BlockScope scope)
visit
in class ASTVisitor
public void endVisit(WhileStatement whileStatement, BlockScope scope)
endVisit
in class ASTVisitor
public boolean visit(LabeledStatement labeledStatement, BlockScope scope)
visit
in class ASTVisitor
public void endVisit(LabeledStatement labeledStatement, BlockScope scope)
endVisit
in class ASTVisitor
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |