Coccinelle release-1.0.0-rc11
[bpt/coccinelle.git] / tests / posmult.cocci
CommitLineData
34e49164
C
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@
7position p;
8expression E;
9statement S,S1;
10@@
11
12E = NULL
13... when != E = ALLOC(...)
14if@p (\(E\|!E\)) S else S1
15
16@@
17expression E, E1;
18statement S,S1;
19position p1 != n.p;
20@@
21
22* E = ALLOC(...)
23... when != E = E1
24* if@p1 (\(E\|!E\))
25 S else S1