作者投稿和查稿 主编审稿 专家审稿 编委审稿 远程编辑

计算机工程 ›› 2009, Vol. 35 ›› Issue (15): 50-52. doi: 10.3969/j.issn.1000-3428.2009.15.017

• 软件技术与数据库 • 上一篇    下一篇

一种建立控制依赖子图的方法

吕 蕾1,刘 弘1,李 鑫2   

  1. (1. 山东师范大学信息科学与工程学院,济南 250014;2. 哈尔滨工业大学计算机科学与技术学院,哈尔滨 150001)
  • 收稿日期:1900-01-01 修回日期:1900-01-01 出版日期:2009-08-05 发布日期:2009-08-05

Method of Building Control Dependence Sub-graph

LV Lei1, LIU Hong1, LI Xin2   

  1. (1. School of Information Science & Engineering, Shandong Normal University, Jinan 250014; 2. School of Computer Science and Technology, Harbin Institute of Technology, Harbin 150001)
  • Received:1900-01-01 Revised:1900-01-01 Online:2009-08-05 Published:2009-08-05

摘要: 提出一种基于GCC(GNU Compiler Collection)抽象语法树文本建立控制依赖子图的方法,消除抽象语法树文本中与分析控制流无关的信息,将消除冗余后的抽象语法树文本转化为以邻接表为存储结构的抽象语法树的算法,从而高效地完成了抽象语法树的解析。基于以邻接表为存储结构的抽象语法树建立了控制依赖子图。通过实验证明了该方法的正确性和适用性。

关键词: 抽象语法树, 抽象语法树文本, 抽象语法树的解析, 规范化的抽象语法树文本, 冗余, 控制依赖子图

Abstract: A method of building control dependence sub-graph is put forward based on Abstract Syntax Tree(AST) text produced by GNU Compiler Collection(GCC). The information which has nothing to do with control flow analysis is eliminated. An algorithm of transforming canonical AST text to AST is put forward. As a result, the AST analysis is more efficiently completed. Control dependence sub-graph is built based on canonical AST. The correctness and practicality of this method is proved by experiments.

Key words: Abstract Syntax Tree(AST), AST text, AST parsing, canonical AST text, redundancy, control dependence sub-graph

中图分类号: