simple but flexible AST traversal with pre and post visitors