adding a printer for query expressions - its a debug-only feature - makes it easier to analyze the queries

Did you try looking at the default expression visitor as a base class?