Agreed. Isn’t that what most of the framework based IDEs do for you? Look at .net Web mvc or rest api application for example - code generated from wizard after wizard. And then the developer massages the rest.
It mentions yacc/lex as bad idea, because they generate code that needs to be compiled again. It is perfectly possible to implement an interpreting parser, which parses some input from a grammar that is specified in some means. (If you have the grammar of the grammar, you could even use it to parse the grammar.) An example of this can be found at: https://github.com/FransFaase/IParse
So, you write source S from which you generate T, which you edit into U.
When you have to change S to S’, which generates T’, you have to do a merge to get U’.
For example, the C preprocessor is fine, as long as you don’t start editing its output.
Similarly, Java annotations that generate code are fine in this respect.