问题描述
我正在使用编程语言 Ya 编写新的Transpiler编译器.由于 AST抽象语法树转换和输出语言代码生成很重要,因此我希望使用现有的 tree#graph转换器和输出生成器= pretty打印机.但是由于找不到使用示例,因此至今未能找到该工具.我已阅读过的有前途的工具列表:
I'm writing new transpiler compiler of my programming language Ya. Since the AST Abstract Syntax Tree transformations and output language code generations is a big deal then I'm looking to use existing tree#graph transformers and output generators = pretty printers.Yet up now failed to find the tool since failed to find use examples.The list of promising tools that I've read about:
- Spoofax + Stratego/XT :尚未找到源代码;也许找到了,但是它是在Java中不允许评估Stratego lang的功能.
- Rascal MPL .它只有 JVM 执行=>作为初始的 C ++ 关注者如果要使用它,我会遇到麻烦.
- OBJ OBJ3 Maude .一无所知.
- Spoofax + Stratego/XT : have not found source code up now; or maybe found but it's in Java that disallows to evaluate the power of Stratego lang.
- Rascal MPL. It has only JVM execution => as initial C++ follower I'm in trouble to use it if to.
- OBJ OBJ3 Maude. Know nothing.
还发现:
- Coctail http://cocolab.com 的费用为3000欧元,因此使用隐藏的源代码,因此看不到其源代码代码作为使用的最佳示例=>无法评估其功能. 3,000欧元也将为我禁用此功能.
- Coctail http://cocolab.com costs €3K so with hidden source code so can't see it's source code as best example of use => can't evaluate it's power. €3K also near to disable this for me.
问题:
- 是否还有其他 tree#graph转换工具#langs#来自 AST _like数据的源代码文本的输出者?
- 寻找graph#tree转换器好的+大的+复杂的用法示例.期望编译器源代码是最好的情况.
- 欢迎使用 Sofofax Stratego/XT Rascal Obj 的所有创意.
- Are there other tree#graph transformation tools#langs # outputers of source code text from AST_like data?
- Looking for graph#tree transformer good+big+complex usage examples. Expecting that compiler source code is the best case.
- All ideas for Spoofax Stratego/XT Rascal Obj are welcome.
推荐答案
您的问题非常广泛,我将尝试从Rascal角度回答.
Your question is very broad and I will try to answer it from the Rascal perspective.
首先,Rascal为具体和抽象语法树提供了广泛的支持.前者是包含所有词汇信息的具体解析树,可以非常方便地遍历,分析和转换.保留所有文本信息对于重新设计应用程序很重要,但是在编写编译器时也很方便.后者是也可以遍历和转换的抽象数据类型(类型树).
First, Rascal provides extensive support for both concrete and abstract syntax trees. The former are concrete parse trees including all lexical information and can be very conveniently traversed, analyzed and transformed. Preserving all textual information is important for reengineering applications but is convenient in compiler writing as well. The latter are abstract data types (typed trees) that can be traversed and transformed as well.
第二,Rascal提供了内置的数据类型,例如地图,集合和关系,可用于方便地计算关系数据.实际上,许多关系代数运算符(例如join和及物传递闭包)是内置的.我们一直在使用它来处理类似图形的数据.
Second, Rascal provides built-in data types like maps, sets and relations that can be used to conveniently compute with relational data. In fact, many relational algebra operators such as join and transitive closure are built-in. We use this all the time to manipulate graph-like data.
第三,Rascal提供了复杂的字符串模板,其中包括代码生成.
Third, Rascal provides sophisticated string templates for, amongst others, code generation.
第四,Rascal实现是基于JVM和JVM字节代码生成的,这是正确的.但是,我们将Rascal应用程序打包为独立的jar,因此可以独立部署和执行用Rascal编写的工具.
Fourth, it is correct that the Rascal implementation is based on the JVM and JVM byte code generation. However, we package Rascal applications as self-contained jars, hence a tool written in Rascal can be deployed and executed independently.
最后,有许多用法示例,包括几个大型编译器,源代码分析,许多DSL(研究和商业用途的DSL)以及其他应用程序.
Finally, there are many usage examples including several large compilers, source code analysis, many DSLs (both in research and commercial), and other applications.
希望这可以进一步帮助您进行探索!
Hope this can further help you in your explorations!
这篇关于寻找graph#tree变压器用法示例的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!