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

CPCC抽象语法树的三地址码生成
引用本文:刘奔,王亚刚,韩俊刚. CPCC抽象语法树的三地址码生成[J]. 数字社区&智能家居, 2013, 0(12): 7753-7758,7764
作者姓名:刘奔  王亚刚  韩俊刚
作者单位:西安邮电大学计算机学院,陕西西安710121
摘    要:为了便于代码优化及指令生成,在并行C语言编译器CPCC(Concordia Parallel C Compiler)将源程序的抽象语法树(Abstract Syntax Tree, AST)转换成目标机PAAG(Parallel Array Architecture GPU)处理器的汇编代码时,采用了三地址码作为中间表示形式。基于CPCC AST的结构特点,将AST到三地址码的转换分为三类,即一般表达式的翻译、布尔表达式的翻译以及语句的翻译,并给出了其详细设计思路及是实现方法。实验结果表明,该方案实现了从源码的抽象语法树到三地址码的转换。

关 键 词:编译器  中间表示  抽象语法树  三地址码

Implementation of Three Address Code Based on CPCC AST
LIU Ben,WANG Ya-gang,HAN Jun-gang. Implementation of Three Address Code Based on CPCC AST[J]. Digital Community & Smart Home, 2013, 0(12): 7753-7758,7764
Authors:LIU Ben  WANG Ya-gang  HAN Jun-gang
Affiliation:(Dept.of Computer., Xi' an Univ.of Post & Telecommunication, Xi' an 710121, China)
Abstract:To facilitate code optimization and code generation, three address code is used as the intermediate representation in translating abstract syntax tree, which generated from source C program by parallel C compiler CPCC(Concordia Parallel C Compiler), into assemble code of target machine PAAG(Parallel Array Architecture GPU). According to structural characteristic of AST in CPCC, the translation from AST into three address code is categorized tree types:general expression translation, bool-ean expression translation and statement translation. A detailed design and realization method are given. Result of this experiment shows the method completing the translation from AST into Three Address Code.
Keywords:Compiler  Intermediate Representation  Abstract Syntax Tree(AST)  Three Address Code
本文献已被 维普 等数据库收录!
设为首页 | 免责声明 | 关于勤云 | 加入收藏

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