首页> 外文期刊>Electronics and Electrical Engineering >Aspect-Oriented Attribute Grammars
【24h】

Aspect-Oriented Attribute Grammars

机译:面向方面的属性语法

获取原文
获取原文并翻译 | 示例
           

摘要

Attribute grammars were introduced by D. Knuth [1] and since then have proved to be useful in specifying the semantics of programming languages and in the automatic construction of compilers and interpreters. While implementation of programming languages is the original and most-widely recognized area of attribute grammars, they are also used in many other areas such as [2]: natural language interfaces, graphical user interfaces, visual programming, pattern recognition, hardware design, communication protocols, software engineering, static analysis of programs, databases, etc. However, only a few commercial compilers have been developed using attribute grammars as a design and implementation tool. It has been argued that attribute grammars are unsuitable for the production of high-speed compilers for general-purpose programming languages, since they are just a model of compilation and, thus, too primitive for real engineering discipline, and that they do not directly support the generation and optimization of machine code. The first problem is concerned with the pragmatic aspects of ordinary attribute grammars. Ordinary attribute grammars have deficiencies which become apparent in specifications for real programming languages. Such specifications are large, unstructured, and hard to understand, modify and maintain. Yet worse still, small modifications of some parts in the specification have widespread effects on the other specification parts. There has been a lot of research work on augmenting ordinary attribute grammars with extensions in order to overcome the deficiencies of attribute grammars, such as lack of modularity, extensibility and reusability. Several concepts, such as remote attribute access, object-orientation, templates, rule models, symbol computations, high order features etc., have been implemented in various attribute grammar specification languages. This problem is still insufficiently solved, despite all these different approaches. The aspect-oriented attribute grammar, introduced in this paper, is proposed to better solve this problem. In aspect-oriented attribute grammar, concepts from aspect-oriented programming [3] have been integrated with attribute grammars. Aspect-oriented programming is a recently proven approach for describing crosscutting concerns in a modular manner. The second problem of attribute grammars, the lack of proper support for code generation and optimization, has also been insufficiently solved as yet and is out of the scope of this paper. An immediate conclusion might be, however, that attribute grammars are more appropriate in the design and implementation of Domain-Specific Languages (DSLs) [4] rather than for development of conventional optimizing compilers. Domain-specific languages, such as database query languages, robot-control languages, hardware design languages, and mark-up languages are usually developed with an emphasis on high-level application abstractions rather than on optimal performance. On the other hand, there is a strong case for formally specifying the syntax and semantics of DSLs [4]. The proposed aspect-oriented attribute grammar is a feasible formalism from which a DSL compiler, as well as related tools, (e.g., debuggers) [5] can be automatically generated.
机译:属性语法是D. Knuth [1]引入的,从那以后,它被证明对指定编程语言的语义以及在自动编译器和解释器中很有用。尽管编程语言的实现是属性语法的原始且得到最广泛认可的领域,但它们还用于许多其他领域,例如[2]:自然语言界面,图形用户界面,可视化编程,模式识别,硬件设计,通信协议,软件工程,程序的静态分析,数据库等。但是,只有少数商业编译器使用属性语法作为设计和实现工具进行了开发。有人认为属性语法不适合用于通用编程语言的高速编译器,因为它们只是一种编译模型,因此对于实际的工程学科而言太原始了,并且它们不直接支持机器代码的生成和优化。第一个问题与普通属性语法的实用性有关。普通属性语法有一些缺陷,这些缺陷在实际编程语言的规范中变得显而易见。这样的规范大,结构化并且难以理解,修改和维护。更糟糕的是,对规范中某些部分的细微修改对其他规范部分具有广泛的影响。为了克服诸如缺乏模块化,可扩展性和可重用性之类的属性语法的缺陷,已经进行了许多有关扩展扩展普通属性语法的研究工作。各种概念,例如远程属性访问,面向对象,模板,规则模型,符号计算,高阶特征等,已经以各种属性语法规范语言实现。尽管采用了所有这些不同的方法,但仍未充分解决此问题。为了更好地解决这一问题,本文提出了面向方面的属性语法。在面向方面的属性语法中,面向方面编程[3]的概念已与属性语法集成在一起。面向方面的编程是一种最近被证明有效的方法,用于以模块化方式描述横切关注点。属性语法的第二个问题,即缺少对代码生成和优化的适当支持,也尚未得到充分解决,这超出了本文的范围。但是,直接得出的结论可能是,属性语法更适合于领域特定语言(DSL)的设计和实现[4],而不是用于开发传统的优化编译器。特定于领域的语言(例如数据库查询语言,机器人控制语言,硬件设计语言和标记语言)通常是在强调高级应用程序抽象而非最佳性能的情况下开发的。另一方面,在形式上指定DSL的语法和语义方面有很强的理由[4]。所提出的面向方面的属性语法是一种可行的形式主义,可以从中自动生成DSL编译器以及相关工具(例如调试器)[5]。

著录项

相似文献

  • 外文文献
  • 中文文献
  • 专利
获取原文

客服邮箱:kefu@zhangqiaokeyan.com

京公网安备:11010802029741号 ICP备案号:京ICP备15016152号-6 六维联合信息科技 (北京) 有限公司©版权所有
  • 客服微信

  • 服务号