Yeah, when the language isn&#x27;t flexible enough to let me get rid of boilerplate using its own primitives, I like doing that too. AST classes are a good example of something where a simple script can pound them out.<p>When I was working on Magpie, I did just that. This script[1] generates this file[2].<p>[1]: <a href="https:&#x2F;&#x2F;github.com&#x2F;munificent&#x2F;magpie&#x2F;blob&#x2F;master&#x2F;script&#x2F;generate_ast.py" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;munificent&#x2F;magpie&#x2F;blob&#x2F;master&#x2F;script&#x2F;gene...</a>
[2]: <a href="https:&#x2F;&#x2F;github.com&#x2F;munificent&#x2F;magpie&#x2F;blob&#x2F;master&#x2F;src&#x2F;Syntax&#x2F;Ast.generated.h" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;munificent&#x2F;magpie&#x2F;blob&#x2F;master&#x2F;src&#x2F;Syntax&#x2F;...</a><p>I got this trick from Jim Hugunin, of Jython and IronPython fame.