Rewritable Reference Attributed Grammars

Rewritable Reference Attributed Grammars
复制标题

可重写参考属性语法

DOI:
--
复制
发表时间:
2004
期刊:
European Conference on Object-Oriented Programming
影响因子:
--
通讯作者:
G. Hedin
G. Hedin
中科院分区:
--
文献类型:
--
作者:
Torbjörn Ekman;G. Hedin

文献摘要

被引文献

相似文献

本论文提出一种面向对象的技术来重写抽象语法树,以简化编译。该技术,可重写引用属性语法(ReRAG),是完全声明性的,并支持重写和计算的属性。我们已经在我们的面向方面的编译器编译器工具JastAdd II中实现了ReRAG。我们提出了ReRAG形式主义,它的评估算法,以及它的使用的例子。JastAdd II使用三种协同机制来支持关注点分离:继承模型模块化,横切关注点的方面,以及允许在最合适的模型上表达计算的重写。这允许编译器以高级声明和模块化的方式编写,支持语言可扩展性以及为不同的编译器相关工具重用模块。每种技术都使用一系列简化的Java编程语言静态语义分析示例。一个案例研究,ReRAG被广泛用于实现IEC 61131 -3自动化语言的控制模块扩展的编译器。该控制模块概念以模块化的方式进一步扩展,具有面向对象的特性,以改进封装,组合机制,代码重用和类型安全。(减)
This thesis presents an object-oriented technique for rewriting abstract syntax trees in order to simplify compilation. The technique, Rewritable Reference Attributed Grammars (ReRAGs), is completely declarative and supports both rewrites and computations by means of attributes. We have implemented ReRAGs in our aspect-oriented compiler compiler tool JastAdd II. We present the ReRAG formalism, its evaluation algorithm, and examples of its use. JastAdd II uses three synergistic mechanisms for supporting separation of concerns: inheritance for model modularization, aspects for cross-cutting concerns, and rewrites that allow computations to be expressed on the most suitable model. This allows compilers to be written in a high-level declarative and modular fashion, supporting language extensibility as well as reuse of modules for different compiler-related tools. Each technique is presented using a series of simplified examples from static semantic analysis for the Java programming language. A case study is presented where ReRAGs are used extensively to implement a compiler for the Control Module extension to the IEC61131-3 automation languages. That Control Modules concept is further extended, in a modular fashion, with object-oriented features to improve encapsulation, composition mechanisms, code re-use, and type safety. (Less)