compile-time traversal of the tree to compute the placeholder map