摘要
中间表示是提高编译器的可移植性和代码生成的有效性的关键技术.为提高编译成份的可复用性,简化编译器的构造,本文提出了一种描述程序语言抽象语法及编译器内部数据结构的抽象中间表示AIR(Abstract Inter-mediate Representation).AIR以代数数据类型为主体,并用面向对象特征对其进行扩展,从而使之具有简洁的语法,较强的表达能力、灵活性和可扩展性.AIR将抽象描述与其具体实现相分离,可方便地用不同的高级程序语言实现,从而有助于提高编译成份间的互操作性.
The design of an intermediate representation is critical to compiler portability and code generation efficiency. In order to increase the reusability of compiler components, and to simplify the development process of compilers, the paper presents an abstract intermediate representation (AIR) that provides a concise notation for describing the abstract syntax of programming languages and the inner data structures of compilers. AIR integrates algebraic data types into the object-oriented paradigm and thus makes it have stronger expressive power,flexibility, and extensibility. AIR separates the abstract descriptions from the concrete implementation. This makes it easier to be implemented in different high-level languages and thus improves the interoperatibility of compiler components. We use AIR to simulate the core of the SUIF written in C + + . The result states that AIR has stronger expressive power and more compact syntax than the other languages for describing the abstract syntax of programming languages.
出处
《电子学报》
EI
CAS
CSCD
北大核心
2002年第12A期2134-2137,共4页
Acta Electronica Sinica
基金
国家自然科学基金(No.60083004)
关键词
中间表示
代数数据类型
面向对象
编译系统
编译器
intermediate representations
algebraic datatypes
object-orientation
compiler systems