引用本文: | 吴翔虎,曲明成,李建中,王志超.活动图并发语义代码自动生成算法设计[J].哈尔滨工业大学学报,2012,44(9):85.DOI:10.11918/j.issn.0367-6234.2012.09.015 |
| WU Xiang-hu,QU Ming-cheng,LI Jian-Zhong,WANG Zhi-chao.Design of automatic code generation algorithm based on concurrency semantics of activity diagrams[J].Journal of Harbin Institute of Technology,2012,44(9):85.DOI:10.11918/j.issn.0367-6234.2012.09.015 |
|
摘要: |
针对活动图能够比状态图更自然和直观地显示程序的并发行为,为达到图形化描述程序的并发行为并自动生成代码的目标,通过分析活动图的图元语义,以fork、join、activity、initial、activity final、flow final等6个图元作为图形建模和代码生成的基础,提出了一套代码自动生成算法.该算法把活动图拆分成若干独立的活动子图;再把每个活动子图解析成若干进程和信号量;最后对每一个进程和信号量进行代码生成.实验证明,基于本算法开发的原型系统取得了较满意的效果,同时也证明了所提出的方法和算法的正确性、有效性. |
关键词: 代码自动生成 活动图 并发语义 |
DOI:10.11918/j.issn.0367-6234.2012.09.015 |
分类号:TP311 |
基金项目:国家高技术研究发展计划资助项目(2005AA742013). |
|
Design of automatic code generation algorithm based on concurrency semantics of activity diagrams |
WU Xiang-hu, QU Ming-cheng, LI Jian-Zhong, WANG Zhi-chao
|
School of Computer Science and Technology, Harbin Institute of Technology,150001 Harbin, China
|
Abstract: |
Compared with state diagram, activity diagram can be used to display the concurrent behavior of program in a more natural and intuitive way. Six primitives of initial, fork, join, flow final, activity final and activity were selected as the basis for graphical modeling and automatic code generation. A XML document format was defined to describe the activity diagram, then the XML document was parsed based on DOM, after that original activity diagram was split into separate activity sub-diagrams; and then each activity diagram was parsed into a number of processes and semaphores and codes. The methods and algorithms proposed were tested by designing and implementing a software system and good results were achieved, it showed that the methods and algorithms were right and effective. |
Key words: automatic code generation activity diagram concurrency semantic |