Called once for every node, children before parents (depth-first). Return a replacement
FormulaNode to substitute the node, or undefined/void to leave it alone.
Replacement is copy-on-write — untouched subtrees are shared. The ROOT is visited last with
parent === undefined, so a whole-tree (multi-pass) rewrite is simply a visitor that acts
only there and returns the new root.
parent is the enclosing node — needed by parent-sensitive rules (e.g. @ directly under
a tableReference is a this-row marker, elsewhere an implicit intersection).
The transform runs ONCE per formula block on the compiled AST (per-cell re-anchoring and re-imaging stay untouched); a transform that replaces nothing costs no recompile. It must be side-effect free and no-op-safe on a partially parsed (errored) tree.
A structural transform over a formula's tree: a visitor a file format applies to formula text as it reads or writes it (FormulaText.transform).