3 ms·
Yeah, when the language isn'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 o
by munificent 11y ago
Yeah, when the language isn'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.
When I was working on Magpie, I did just that. This script[1] generates this file[2].
[1]: https://github.com/munificent/magpie/blob/master/script/generate_ast.py https://github.com/munificent/magpie/blob/master/script/gene...
[2]: https://github.com/munificent/magpie/blob/master/src/Syntax/Ast.generated.h https://github.com/munificent/magpie/blob/master/src/Syntax/...
I got this trick from Jim Hugunin, of Jython and IronPython fame.