计算机应用 ›› 2019, Vol. 39 ›› Issue (12): 3639-3643.DOI: 10.11772/j.issn.1001-9081.2019050909

• 计算机软件技术 • 上一篇    下一篇

基于Sugiyama的流程图自动生成算法

梁白鸥   

  1. 西南电子技术研究所, 成都 610036
  • 收稿日期:2019-05-30 修回日期:2019-07-18 发布日期:2019-12-17 出版日期:2019-12-10
  • 作者简介:梁白鸥(1982-),男,四川成都人,高级工程师,硕士,主要研究方向:软件辅助设计、航空通信系统软件架构。

Flowchart automatic generation algorithm base on Sugiyama

LIANG Bai'ou   

  1. Southwest China Institute of Electronic Technology, Chengdu Sichuan 610036, China
  • Received:2019-05-30 Revised:2019-07-18 Online:2019-12-17 Published:2019-12-10
  • Contact: 梁白鸥

摘要: 为了解决流程图绘制效率低下的问题,更好地保证软件模型、文档与代码的一致性,提出了一种流程图自动生成算法。首先,通过逆向分析C/C++源代码,提取代码的Token列表,生成Scope树,从而生成流程图。同时,提出了一种规范代码函数体注释的方法,提高流程图的可理解性。最后,应用Sugiyama布局算法,并对坐标指定步骤进行补充改进,对流程图进行了自动布局,最终生成可读流程图。实际应用过程中,所提算法有效地提高了软件设计文档的编写效率,保证了软件模型、文档与代码的一致性。

关键词: 流程图自动生成, 源代码逆向分析, 流程图自动布局, Sugiyama布局算法, 软件逆向工程

Abstract: In order to solve the problem of low efficiency of flowchart drawing and better guarantee the consistency of software model, document and code, an algorithm for automatic generation of flowchart was proposed. Firstly, by analyzing the C/C++ source code in reverse, the Token list of the code was extracted, and the Scope tree was created to realize the flowchart generation. At the same time, a method for regulating the annotation of code functions was proposed, improving the comprehensibility of the flowchart. Finally, the readable flowchart was generated after the automatic layout of flowchart by applying the Sugiyama layout algorithm and completing and improving the coordinate designation step. In the actual application process, with the use of the proposed algorithm, the efficiency of writing software design documents is effectively improved and the consistency of the software model, document and code is guaranteed.

Key words: flowchart automatic generation, source code reverse analysis, flowchart automatic layout, Sugiyama layout algorithm, software reverse engineering

中图分类号: