Project

General

Profile

Task #5010

Conditions in IfStatementBranch

Added by Mikhail Chupilko almost 6 years ago. Updated almost 6 years ago.

Status:
Closed
Priority:
Normal
Target version:
Start date:
06/25/2014
Due date:
% Done:

0%

Estimated time:
Detected in build:
svn
Published in build:
r527

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".

History

#1

Updated by Alexander Kamkin almost 6 years ago

  • 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:
    • see IfStatementBranch.
  • 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:
    • see CaseStatementItem.
#2

Updated by Alexander Kamkin almost 6 years ago

Here is an example:

@Override
public void onIfStatementBranchBegin(final IfStatementBranch node) {
  // Get the branch condition.
  final Expression condition = node.getExpression();

  // Do what you need.
  ...
}
#3

Updated by Alexander Kamkin almost 6 years ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF