Generalize precendence exp rewriter to accept any AST node.