We wrote something quite similar for Bouygues Telecom and based it on an ANTLR grammar [2].
It offers nested filtering out of the box. All feature-packed in a lightweight package.
[1]: https://github.com/bouyguestelecom/spl [2]: https://github.com/BouyguesTelecom/SPL/blob/main/src/antlr/S...
replies(1):