how to match AST nodes in order

Hello,

I have been looking for a way to give traverse nodes in DFS using ast matchers and libtooling. For example I have a below AST -

-BinaryOperator-
-BinaryOperator-
-IntegerLiteral
-IntegerLiteral
-IntegerLiteral

Before matching above binaryOperator Node, I want to match the inner binaryOperator node. Depth could be any, I want to handle innermost node first. Is there any way to achieve this using clang ast matchers and libtooling.

try forEachDescendant() maybe?

binaryOperator(forEachDescendant(binaryOperator().bind("inner")))