-
Notifications
You must be signed in to change notification settings - Fork 0
/
seq.ebnf
78 lines (53 loc) · 2.49 KB
/
seq.ebnf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
/* Иструмент: https://bnfplayground.pauliankline.com/ */
/* Общие */
/* ----------------------------------------------------------------------- */
/* элементарные (или встроенные) конструкции */
<whs> ::= " "
<nln> ::= "\n"
/* допустимые значения для типа char, не только: */
<any_char> ::= ([A-Z] | [a-z] | [0-9] | "_")+
/* допустимые для идентификатора значения PlantUML: */
<ids_char> ::= ([A-Z] | [a-z] | [0-9] | "_")+
/* --- */
<string> ::= <any_char>+
<node_id> ::= <ids_char>+
<optwhs> ::= <whs>*
<reqwhs> ::= <whs>+
<end_curly_brace> ::= "}"
/* Seq */
/* ----------------------------------------------------------------------- */
/* стрелка */
<left_arrow_head> ::= "<"
<rght_arrow_head> ::= ">"
<arrow_direction> ::= ("l" | "r" | "d" | "u") | ("left" | "right" | "down" | "up")
<arrow_body> ::= "-"+ <arrow_direction> "-"+
<arrow> ::= <left_arrow_head>? <arrow_body> <rght_arrow_head>?
/* составные конструкции (не используются напрямую) */
<part_whole_node> ::= "\"" <string> "\"" <reqwhs> "as" <reqwhs> <node_id>
<node> ::= <node_id>
/* составные конструкции (то из чего состоит диаграмма/то что вводит пользователь) */
<enduml> ::= "@enduml"
<startuml> ::= "@startuml"
<directive> ::= <startuml> | <enduml>
/* --- */
/* сторожевое условие */
<condition> ::= <any_char>+
/* перечисление узлов */
<nodes> ::= <any_char>+
<whole_node> ::= ("actor" | "boundary" | "entity" | "control") <reqwhs> <part_whole_node>
<short_node> ::= ("actor" | "boundary" | "entity" | "control") <reqwhs> <node_id>
/* --- */
<connection> ::= <node> <reqwhs> <arrow> <reqwhs> <node>
/* --- */
<beg_fragment> ::= ("alt" | "opt" | "loop" ) <reqwhs> <condition>
<else_opd> ::= "else" <reqwhs> <any_char>+
<end_opd> ::= "end"
<fragment_body> ::= (<connection> <nln>)+ (<else_opd> <nln>)?
<fragment> ::= <beg_fragment> <nln> <fragment_body> <end_opd>
<beg_ref_over> ::= "ref" <reqwhs> "over" <reqwhs> <nodes>
<end_ref> ::= <end_opd> <reqwhs> "ref"
<ref_over_body> ::= (<string> <nln>)+
<ref_over> ::= <beg_ref_over> <nln> <ref_over_body> <end_ref>
<grouping> ::= (<fragment> | <ref_over>)
/* --- */
<diagram> ::= <startuml> <nln> ((<whole_node> | <short_node> | <connection> | <grouping>) <nln>)* <enduml>