从GCC的AST文本提取C源程序静态信息的方法
CSTR:
作者:
作者单位:

作者简介:

通讯作者:

中图分类号:

TP391.1

基金项目:

国家自然科学基金资助项目(60673035)


Extraction of static information of C program from GCC abstract syntax tree text
Author:
Affiliation:

Fund Project:

  • 摘要
  • |
  • 图/表
  • |
  • 访问统计
  • |
  • 参考文献
  • |
  • 相似文献
  • |
  • 引证文献
  • |
  • 资源附件
  • |
  • 文章评论
    摘要:

    为了能够正确的分析源程序的控制依赖关系和数据依赖关系,以便在此基础上进行程序切片及冗余代码和重复代码检测,提出一种利用GCC抽象语法树(AST)文本来提取源程序静态信息的方法.首先,对GCCAST文本进行标准化及消除文本中与控制流分析和数据流分析无关的结点信息;其次,构建控制依赖子图;同时如果需要数据流分析,在控制依赖子图的基础上构建控制流图,在控制流图的基础上构建数据流子图;最后通过引入过程间分析来完善系统依赖图.实验结果表明,这种方法基本能正确的分析源程序的控制依赖和数据依赖关系,具有更好的适应性和灵活性.

    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.

    参考文献
    相似文献
    引证文献
引用本文

封战胜,苏小红,马培军.从GCC的AST文本提取C源程序静态信息的方法[J].哈尔滨工业大学学报,2010,42(7):1100. DOI:10.11918/j. issn.0367-6234.2010.07.020

复制
相关视频

分享
文章指标
  • 点击次数:
  • 下载次数:
  • HTML阅读次数:
  • 引用次数:
历史
  • 收稿日期:
  • 最后修改日期:
  • 录用日期:
  • 在线发布日期: 2012-05-03
  • 出版日期:
文章二维码