Release coccinelle-0.1
[bpt/coccinelle.git] / tests / posmult.cocci
1 // shows the expressive power added by positions
2 // normally, we find one root and then explore its children.
3 // here the root is in some sense the if, and we want to see if it can
4 // be reached from two contexts
5
6 @n@
7 position p;
8 expression E;
9 statement S,S1;
10 @@
11
12 E = NULL
13 ... when != E = ALLOC(...)
14 if@p (\(E\|!E\)) S else S1
15
16 @@
17 expression E, E1;
18 statement S,S1;
19 position p1 != n.p;
20 @@
21
22 * E = ALLOC(...)
23 ... when != E = E1
24 * if@p1 (\(E\|!E\))
25 S else S1