There are scanner generators. There are parser generators. But why do we avoid semantics generators? What would be a good language to specify this part of a compiler?
Reasoning About Recursive Tree Traversals
https://engineering.purdue.edu/~xqiu/ppopp2021_authorversion.pdf