I am trying to search for ifStmt
s, which aren't an else if
. To accomplish that, I want to test if the Stmt has a Parent, which is not an ifStmt(hasElse(ifStmt(equals(<myCurrentNode>))))
The following obviously does not work, but I could not find a better solution.
clang-query> m ifStmt(<myMatcherforMyNode>, unless(hasParent(ifStmt(hasElse(ifStmt(equalsBoundNode("ifelse"))))))).bind("ifelse")