首页> 外文学位 >COMPILE-TIME EVALUATION AND CODE GENERATION FOR SEMANTICS-DIRECTED COMPILERS (DENOTATIONAL).
【24h】

COMPILE-TIME EVALUATION AND CODE GENERATION FOR SEMANTICS-DIRECTED COMPILERS (DENOTATIONAL).

机译:面向语义的编译器的编译时评估和代码生成(代名词)。

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

摘要

Programming languages have traditionally been specified in two different forms: by informal (and often imprecise) descriptions in reference manuals, and by implementations of compilers. While the latter are necessarily quite formal (as they must to be executed by computers), they do not serve as a good means to communicate programming language semantics, or as a good basis for reasoning about programs.; Since the introduction of Denotational Semantics to describe programming language semantics, significant progress has been made in being able to automatically derive compilers from Denotational Semantic specifications of programming languages. These specifications can be used both for communication between designers and users, and for automatic translation from the languages they specify into executable machine code.; The compilers produced by such semantics-directed compiler generators have not been as powerful as conventional compilers, in two ways. Some automatically-generated compilers produce semantic structures which must be interpreted many orders of magnitude slower than the equivalent machine code produced by a conventional compiler. Others produce efficient machine code but only handle a small subset of a typical programming language's semantics.; Both of these problems are a consequence of an inability to do enough compile-time evaluation. For example, in a language like Pascal, all of the type checking and representation selection can and should be done at compile time.; By choosing a set of combinators which intuitively correspond to register-transfer operations (the atomic operations of von Neumann machines) the process of compilation can be treated as the reduction of a (large) (lamda)-expression to a normal form in these combinators. Compile-time evaluation during the reduction to normal form includes the allocation of static storage, the selection of data-type representations, type checking and coercion, and constant folding.; An algorithm is given for generating code from the normal form. Thus, a true compiler, not just an interpreter, is specified by giving a Denotational Semantics for the language. The compiler-generator has been fully implemented; it has been used to specify working compilers for Pascal and C. The automatically-generated compilers are slow. However, the machine code they produce is comparable in efficiency to what is produced by conventional hand-built compilers.
机译:传统上,编程语言是用两种不同的形式指定的:参考手册中的非正式(通常是不精确的)描述,以及编译器的实现。尽管后者必须是相当正式的(因为它们必须由计算机执行),但它们并不是交流编程语言语义的好方法,也不是进行程序推理的良好基础。自从引入描述语言来描述编程语言语义以来,在能够自动从编程语言的语义语义规范派生编译器方面取得了重大进展。这些规范既可以用于设计者与用户之间的通信,也可以用于将他们指定的语言自动翻译成可执行的机器代码。这种由语义控制的编译器生成器生成的编译器在两种方面没有常规编译器强大。一些自动生成的编译器会产生语义结构,这些语义结构的解释速度必须比常规编译器产生的等效机器代码慢多个数量级。其他的则产生有效的机器代码,但只处理典型编程语言语义的一小部分。这两个问题都是无法进行足够的编译时评估的结果。例如,在Pascal之类的语言中,所有类型检查和表示选择都可以并且应该在编译时完成。通过选择一组直观地对应于寄存器转移操作(冯·诺伊曼机器的原子操作)的组合器,编译过程可以看作是将这些组合器中的(大)(lamda)表达式还原为正常形式。 。简化为标准格式时的编译时评估包括静态存储的分配,数据类型表示的选择,类型检查和强制以及常量折叠。给出了一种从标准形式生成代码的算法。因此,通过给出一种语言的指称语义,可以指定一个真正的编译器,而不仅仅是一个解释器。编译器生成器已完全实现;它已被用来指定Pascal和C的可用编译器。自动生成的编译器很慢。但是,它们产生的机器代码在效率上可与传统的手工编译器产生的机器代码相媲美。

著录项

  • 作者

    APPEL, ANDREW WILSON.;

  • 作者单位

    Carnegie Mellon University.;

  • 授予单位 Carnegie Mellon University.;
  • 学科 Computer Science.
  • 学位 Ph.D.
  • 年度 1985
  • 页码 195 p.
  • 总页数 195
  • 原文格式 PDF
  • 正文语种 eng
  • 中图分类 自动化技术、计算机技术;
  • 关键词

相似文献

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

客服邮箱:kefu@zhangqiaokeyan.com

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

  • 服务号