Start here

Home
About Klocwork
What's new
Fixed issues
Release notes
Installation

Reference

C/C++ checkers
Java checkers
C# checkers
MISRA C 2004 checkers
MISRA C++ 2008 checkers
MISRA C 2012 checkers
MISRA C 2012 checkers with Amendment 1
Commands
Metrics
Troubleshooting
Reference

Product components

C/C++ Integration build analysis
Java Integration build analysis
Desktop analysis
Refactoring
Klocwork Static Code Analysis
Klocwork Code Review
Structure101
Tuning
Custom checkers

Coding environments

Visual Studio
Eclipse for C/C++
Eclipse for Java
IntelliJ IDEA
Other

Administration

Project configuration
Build configuration
Administration
Analysis performance
Server performance
Security/permissions
Licensing
Klocwork Static Code Analysis Web API
Klocwork Code Review Web API

Community

View help online
Visit RogueWave.com
Klocwork Support
Rogue Wave Videos

Legal

Legal information

Other extensions

KAST expressions and path conditions can contain iterative sequences. An iterative sequence is a subpath starting with a node type and ending with a qualifier.

Iterative sequences are surrounded by braces and can be placed between qualifiers and node type names:

//ExprBinary/Expr1::{ExprBinary/Expr2::}ExprConst

An iterative sequence can be matched at the corresponding place zero or more times. The above example is equivalent to an infinite number of expressions:

//ExprBinary/Expr1::ExprConst //ExprBinary/Expr1::ExprBinary/Expr2::ExprConst //ExprBinary/Expr1::ExprBinary/Expr2::ExprBinary/Expr2::ExprConst

When you are not interested in the actual type of a node, you may use the '*' symbol instead of a type name. But sometimes it's better to use the 'short anonymous children' notation:

<Child name>

is equivalent to

<Child name>::*

For example, the following conditions are equivalent:

[isConstant(Expr1::*)], [isConstant(Expr1)], [(Expr1::*).isConstant()] and [Expr1.isConstant()]

Note that '*' cannot be omitted in all cases. You should use the full syntax in iterative sequences and for non-final elements of KAST expressions. Consider the following example.

This expression:

//ExprBinary/Expr2::*[isConstant()]

cannot be replaced with

//ExprBinary/Expr2[isConstant()]

because square brackets after names are used for specifying sibling indices.