最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

antlr - Reproducible Way to Create an AST from a Parse Tree - Stack Overflow

programmeradmin2浏览0评论

For my GameVM project I'm using ANTLR v4 to create multiple compiler frontends. Generating the lexer and parser for each language saved me a ton of work (especially since I have no background in compiler writing), but I'm getting bogged down on implementing ASTs for each language.

The AST is just the next step. I'm planning on supporting at least 10 different languages that will be transformed to a yet to be decided IR.

Maybe there's no way to transform a parse tree to an AST but by implementing the node types one at a time and writing visitor functions to do the translation but I can't help but feel there's an easier way to do this.

Any ideas or help would be appreciated

发布评论

评论列表(0)

  1. 暂无评论