概述
流程图的语法大致分为两部分。
- 定义元素
- 连接元素
定义元素
tag=>type: content:>url
- tag:标签,用于连接元素时使用
type:该标签的类型。共有6种类型如下:
start
end
operation
subroutine
condition
inputoutputcontent:流程语句中放置的内容
- type:与content之间一定要有一个空格,否则会出问题!
url:链接,与流程语句绑定
连接元素
使用->符号,如:
c2(yes)->io->e
c2(no)->op2->e
实例
牢记tag=>type: content:>url
st=>start: Start|past:>http://www.baidu.com
e=>end: End:>http://www.baidu.com
op1=>operation: My Operation|past
op2=>operation: Stuff|current
sub1=>subroutine: My Subroutine|invalid
cond=>condition: Yes or No?|approved:>http://www.baidu.com
c2=>condition: Good idea|rejected
io=>inputoutput: catch something...|request
st->op1(right)->cond
cond(yes, right)->c2
cond(no)->sub1(left)->op1
c2(yes)->io->e
c2(no)->op2->e
实际实现效果
st=>start: Start
e=>end: End
cond=>condition: Option
op1=>operation: solution_1
op2=>operation: solution_2
st->cond
cond(yes)->op1->e
cond(no)->op2->e
实际实现效果
st=>start: Start
e=>end: Why are you worried?
cond1=>condition: Do you have a problem?
cond2=>condition: Can you solve it?
op=>operation: Since you can't solve it,
st->cond1
cond1(yes)->cond2
cond1(no)->e
cond2(yes)->e
cond2(no)->op->e