Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在使用 python 的 grako 实用程序将我的 OIL 文件解析为 AST。但我想在修改 AST 后从 AST 重新生成源代码。grako 是否具有执行此操作的功能,或者 python 中的任何其他实用程序都可用于此源代码重新生成。
Grako 风格的代码生成是通过使用string.Formatter.
string.Formatter
查看grako.codegen和grako.model模块/包,并查看examples/antlr2grako示例。
grako.codegen
grako.model
examples/antlr2grako
代码生成是 Grako 中记录最少的部分之一(在 README 中),但它就在那里。