期刊检索

  • 2024年第56卷
  • 2023年第55卷
  • 2022年第54卷
  • 2021年第53卷
  • 2020年第52卷
  • 2019年第51卷
  • 2018年第50卷
  • 2017年第49卷
  • 2016年第48卷
  • 2015年第47卷
  • 2014年第46卷
  • 2013年第45卷
  • 2012年第44卷
  • 2011年第43卷
  • 2010年第42卷
  • 第1期
  • 第2期

主管单位 中华人民共和国
工业和信息化部
主办单位 哈尔滨工业大学 主编 李隆球 国际刊号ISSN 0367-6234 国内刊号CN 23-1235/T

期刊网站二维码
微信公众号二维码
引用本文:封战胜,苏小红,马培军.从GCC的AST文本提取C源程序静态信息的方法[J].哈尔滨工业大学学报,2010,42(7):1100.DOI:10.11918/j.issn.0367-6234.2010.07.020
FENG Zhan-sheng,SU Xiao-hong,MA Pei-jun.Extraction of static information of C program from GCC abstract syntax tree text[J].Journal of Harbin Institute of Technology,2010,42(7):1100.DOI:10.11918/j.issn.0367-6234.2010.07.020
【打印本页】   【HTML】   【下载PDF全文】   查看/发表评论  下载PDF阅读器  关闭
过刊浏览    高级检索
本文已被:浏览 1700次   下载 2365 本文二维码信息
码上扫一扫!
分享到: 微信 更多
从GCC的AST文本提取C源程序静态信息的方法
封战胜, 苏小红, 马培军
哈尔滨工业大学计算机科学与技术学院
摘要:
为了能够正确的分析源程序的控制依赖关系和数据依赖关系,以便在此基础上进行程序切片及冗余代码和重复代码检测,提出一种利用GCC抽象语法树(AST)文本来提取源程序静态信息的方法.首先,对GCCAST文本进行标准化及消除文本中与控制流分析和数据流分析无关的结点信息;其次,构建控制依赖子图;同时如果需要数据流分析,在控制依赖子图的基础上构建控制流图,在控制流图的基础上构建数据流子图;最后通过引入过程间分析来完善系统依赖图.实验结果表明,这种方法基本能正确的分析源程序的控制依赖和数据依赖关系,具有更好的适应性和灵活性.
关键词:  程序静态分析  AST  控制依赖  数据依赖  控制流图  系统依赖图
DOI:10.11918/j.issn.0367-6234.2010.07.020
分类号:TP391.1
基金项目:国家自然科学基金资助项目(60673035)
Extraction of static information of C program from GCC abstract syntax tree text
FENG Zhan-sheng, SU Xiao-hong, MA Pei-jun
School of Computer Science and Technology,Harbin Institute of Technology,Harbin 150001,China
Abstract:
In order to correctly analyze the control dependence and data dependence relations of C program,and then carry out the program slicing,code redundancy and code duplication detection,a method to extract the static information of C program from GCC AST text was put forward.Firstly,the GCC AST text was standardized and the nodes unrelated to control dependence and data dependence analysis were eliminated.Secondly,control dependence subgraph was constructed.If data flow analysis was necessary,control flow graph was constructed based on control dependence subgraph and data dependence subgraph was constructed based on control flow graph.At last,by the introduction of inter-process analysis,system dependence graph was improved.It is indicated that the research can correctly analyze the control dependence and data dependence relations.
Key words:  program static analysis  abstract syntax tree(AST)  control dependence  data dependence  control flow graph  system dependence graph

友情链接LINKS