Task #5010
closed
Conditions in IfStatementBranch
Added by Mikhail Chupilko over 10 years ago.
Updated over 10 years ago.
Description
To make Cfg one needs some condition to be set for each branch of "if-else" construction. Why doesn't VeriTrans return the condition in "IfStatementBranch" in "onIfStatementBranchBegin"? It should be negation of the correspondent condition in "onIfStatementBegin".
- Status changed from New to Resolved
- Target version set to 0.1
- Detected in build set to svn
- Published in build set to r527
- Tracker changed from Support to Task
The getExpression
methods have been implemented for the following classes:
IfStatementBranch
- returns the condition associated with the if-statement branch:
Construct |
Condition |
if(EXPRESSION) then ... |
EXPRESSION |
if(EXPRESSION) ... else |
not (EXPRESSION) |
IfGenerateBranch
- returns the condition associated with the if-generate branch:
CaseStatementItem
- returns the condition associated with the case-statement item:
Construct |
Condition |
case(EXPRESSION) A: |
(EXPRESSION === A) |
case(EXPRESSION) A, B, ...: |
(EXPRESSION === A) or (EXPRESSION === B) or ... |
case(EXPRESSION) default: |
not (CONDITION 1 or CONDITION 2 or ...) |
CaseGenerateItem
- returns the condition associated with the case-generate item:
Here is an example:
@Override
public void onIfStatementBranchBegin(final IfStatementBranch node) {
// Get the branch condition.
final Expression condition = node.getExpression();
// Do what you need.
...
}
- Status changed from Resolved to Closed
Also available in: Atom
PDF