首页 | 本学科首页   官方微博 | 高级检索  
     检索      

面向对象的元级程序设计方法
引用本文:单郸,刘磊.面向对象的元级程序设计方法[J].吉林大学学报(信息科学版),2005,23(5):529-534.
作者姓名:单郸  刘磊
作者单位:吉林大学,计算机科学与技术学院,长春,130012;吉林大学,计算机科学与技术学院,长春,130012
摘    要:传统的面向过程式的元级程序设计系统存在一些弊端,如指针操作容易出错等.尤其当处理的语言文法规则过多时,过于频繁的指针操作会降低系统的稳定性和可靠性.为此,采用面向对象的元程序设计方法,使用基于文法的抽象语法树描述中间表示,将元级操作封装成类,构造了面向对象的元级程序设计系统OOMPS(Object-Oriented Metaprogramming System).该系统利用类的继承机制以及对象与其成员函数之间的关系来代替指针操作,避免了指针带来的各种问题.基于该方法,实现了全系统简明测试语言ATLAS(Abbreviated Test Language for All Systems,该语言的文法规则大约有2 680条)的元程序设计系统ATLAS_MPS.试验表明,该系统效果优良,并具有稳定性及可扩充性.

关 键 词:元程序设计系统  元程序  目标程序  元级操作  抽象语法树
文章编号:1671-5896(2005)05-0529-06
修稿时间:2004年8月24日

Object-Oriented Metaprogramming Method
SHAN Dan,LIU Lei.Object-Oriented Metaprogramming Method[J].Journal of Jilin University:Information Sci Ed,2005,23(5):529-534.
Authors:SHAN Dan  LIU Lei
Abstract:There are some defects, such as pointer operation which easily makes an error, in the traditional procedure-|oriented metaprogramming. If grammars of the language has too much rules, over frequently operating pointer will decrease the stability and reliability of a system. The OOMS(Object-|Oriented Metaprogramming System) based on the object-|oriented metaprogramming method uses abstract syntax trees based on grammers to describe middle representations, and encapsulates metaoperatings into Class. It substitutes the inheritance mechanism of classes and the relationship of objects and its member functions for pointer operation, accordingly avoids all problems caused by pointer. Basing on this method, a metaprogramming system of ATLAS (Abbreviated Test Language for All Systems), ATLAS_-MPS has been implemented, which grammar has approximately 2 680 rules. The experimentation shows that ATLAS_-MPS is excellent and has well stability and expandability.
Keywords:metaprogramming  system  metaprogram  objectprogram  metaoperating  abstract syntax tree
本文献已被 CNKI 维普 万方数据 等数据库收录!
设为首页 | 免责声明 | 关于勤云 | 加入收藏

Copyright©北京勤云科技发展有限公司  京ICP备09084417号