摘要
程序流程图在整个软件工程的生命周期中发挥着非常重要的作用。在软件设计中,设计人员通常需要先根据算法从结构上画出程序执行流程图,然后再依据流程图写出相应的源程序代码;在分析和维护软件时,如果能先将源程序代码逆向转换成流程图,则可以有效地帮助分析程序结构。显然,若能让计算机自动地实现流程图与源程序代码之间的相互转换,将大量节省软件开发的人力资源和时间耗费。讨论了如何利用基于边的图文法EGG来自动地实现这种转换,并用具体例子展示了应用EGG图文法的归约和推导操作分别实现流程图的语法分析和流程图的逆向生成,前者可以完成从流程图自动生成源程序代码,而后者则可以从源程序代码自动生成流程图。
Flowchart is very important in the lifecycle of software engineering. During the design of a program,programmers usually need to draw a structural flowchart before coding. While in the course of the analysis and maintenance of a program,it can be helpful for programmers to analyze the program's structure by firstly reversing the source codes to a corresponding flowchart. Obviously, automatical transformation between flowcharts and source codes can save plenty of human resources and lots of de- velopment time. We discuss how to make use of the Edge-based Graph Grammar (EGG) to automatical- ly perform the transformation, and demonstrate the realization of grammatical analysis and reverse gener- ation of flowcharts by applying the reduction and derivation operations of the EGG through an example.
出处
《计算机工程与科学》
CSCD
北大核心
2015年第5期937-945,共9页
Computer Engineering & Science
基金
国家自然科学基金资助项目(61170089)
关键词
图文法
流程图
源程序
归约
推导
graph grammar
flowchart
source code
reduction
derivation