Find IF statements with THEN branch containing at least one executable statement
// IfStmt [ Then::CompoundStmt / Stmts[*]::ExprStmt | Then::ExprStmt ]
1 void foo(boolean b) { 2 if (b) { // match this one 3 printf("IfStatement"); 4 } 5 if (b) { // match this one 6 printf("IfStatement: Then"); 7 } 8 else { 9 printf("IfStatement: Else"); 10 } 11 if (b) { // do not match this one 12 /* no code */ 13 } 14 }