Skip to content

Commit ef4f686

Browse files
[plantuml parser]: add activity diagram
1 parent 53d74f1 commit ef4f686

34 files changed

Lines changed: 2071 additions & 2 deletions

File tree

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# *******************************************************************************
2+
# Copyright (c) 2026 Contributors to the Eclipse Foundation
3+
#
4+
# See the NOTICE file(s) distributed with this work for additional
5+
# information regarding copyright ownership.
6+
#
7+
# This program and the accompanying materials are made available under the
8+
# terms of the Apache License Version 2.0 which is available at
9+
# https://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# SPDX-License-Identifier: Apache-2.0
12+
# *******************************************************************************
13+
filegroup(
14+
name = "activity_diagram_files",
15+
srcs = glob(
16+
[
17+
"**/*.puml",
18+
"**/*.json",
19+
"**/*.yaml",
20+
],
21+
allow_empty = True,
22+
),
23+
visibility = ["//visibility:public"],
24+
)
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
' *******************************************************************************
2+
' Copyright (c) 2026 Contributors to the Eclipse Foundation
3+
'
4+
' See the NOTICE file(s) distributed with this work for additional
5+
' information regarding copyright ownership.
6+
'
7+
' This program and the accompanying materials are made available under the
8+
' terms of the Apache License Version 2.0 which is available at
9+
' https://www.apache.org/licenses/LICENSE-2.0
10+
'
11+
' SPDX-License-Identifier: Apache-2.0
12+
' *******************************************************************************
13+
@startuml test_activity_beta_syntax
14+
title "Beta Activity Syntax Coverage"
15+
16+
start
17+
18+
:Initialize parser context;
19+
note left: Basic action and note
20+
21+
if (fatal configuration error?) then (yes)
22+
end
23+
else (no)
24+
:Continue setup;
25+
endif
26+
27+
if (beta syntax enabled?) then (yes)
28+
:Enter beta flow;
29+
if (extra validation needed?) then (yes)
30+
:Run nested validation;
31+
else (no)
32+
:Skip nested validation;
33+
endif
34+
else (no)
35+
:Fallback configuration path;
36+
endif
37+
38+
while (retry budget available?) is (yes)
39+
:Try parse step;
40+
if (parse step succeeded?) then (yes)
41+
break
42+
else (no)
43+
:Update retry state;
44+
endif
45+
endwhile
46+
47+
repeat
48+
#LightBlue:Read next activity token;
49+
if (token available?) then (yes)
50+
:Consume token;
51+
else (no)
52+
break
53+
endif
54+
repeat while (more tokens expected?) is (yes)
55+
56+
:Finalize result;
57+
stop
58+
59+
@enduml
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
' *******************************************************************************
2+
' Copyright (c) 2026 Contributors to the Eclipse Foundation
3+
'
4+
' See the NOTICE file(s) distributed with this work for additional
5+
' information regarding copyright ownership.
6+
'
7+
' This program and the accompanying materials are made available under the
8+
' terms of the Apache License Version 2.0 which is available at
9+
' https://www.apache.org/licenses/LICENSE-2.0
10+
'
11+
' SPDX-License-Identifier: Apache-2.0
12+
' *******************************************************************************
13+
@startuml action_separated
14+
15+
- A1
16+
- A2
17+
- A3
18+
19+
@enduml
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
"action_separated.puml": {
3+
"name": "action_separated",
4+
"statements": [
5+
{
6+
"Action": {
7+
"label": "A1"
8+
}
9+
},
10+
{
11+
"Action": {
12+
"label": "A2"
13+
}
14+
},
15+
{
16+
"Action": {
17+
"label": "A3"
18+
}
19+
}
20+
]
21+
}
22+
}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
' *******************************************************************************
2+
' Copyright (c) 2026 Contributors to the Eclipse Foundation
3+
'
4+
' See the NOTICE file(s) distributed with this work for additional
5+
' information regarding copyright ownership.
6+
'
7+
' This program and the accompanying materials are made available under the
8+
' terms of the Apache License Version 2.0 which is available at
9+
' https://www.apache.org/licenses/LICENSE-2.0
10+
'
11+
' SPDX-License-Identifier: Apache-2.0
12+
' *******************************************************************************
13+
@startuml action_simple
14+
15+
:Hello ""activity diagram"";
16+
:This block is **defined** on
17+
__several__ ~~lines~~;
18+
19+
@enduml
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"action_simple.puml": {
3+
"name": "action_simple",
4+
"statements": [
5+
{
6+
"Action": {
7+
"label": "Hello activity diagram"
8+
}
9+
},
10+
{
11+
"Action": {
12+
"label": "This block is defined on\nseveral lines"
13+
}
14+
}
15+
]
16+
}
17+
}
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
' *******************************************************************************
2+
' Copyright (c) 2026 Contributors to the Eclipse Foundation
3+
'
4+
' See the NOTICE file(s) distributed with this work for additional
5+
' information regarding copyright ownership.
6+
'
7+
' This program and the accompanying materials are made available under the
8+
' terms of the Apache License Version 2.0 which is available at
9+
' https://www.apache.org/licenses/LICENSE-2.0
10+
'
11+
' SPDX-License-Identifier: Apache-2.0
12+
' *******************************************************************************
13+
@startuml arrows
14+
15+
:foo1;
16+
-> You can put text on arrows;
17+
if (test) then
18+
-[#blue]->
19+
:foo2;
20+
-[#green,dashed]-> The text can
21+
also be on several lines
22+
and **very** long...;
23+
:foo3;
24+
else
25+
-[#black,dotted]->
26+
:foo4;
27+
endif
28+
-[#gray,bold]->
29+
:foo5;
30+
31+
@enduml
Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
{
2+
"arrows.puml": {
3+
"name": "arrows",
4+
"statements": [
5+
{
6+
"Action": {
7+
"label": "foo1"
8+
}
9+
},
10+
{
11+
"Arrow": {
12+
"syntax": "->",
13+
"label": "You can put text on arrows"
14+
}
15+
},
16+
{
17+
"IfStart": {
18+
"condition": "test",
19+
"label": null
20+
}
21+
},
22+
{
23+
"Arrow": {
24+
"syntax": "-[#blue]->",
25+
"label": null
26+
}
27+
},
28+
{
29+
"Action": {
30+
"label": "foo2"
31+
}
32+
},
33+
{
34+
"Arrow": {
35+
"syntax": "-[#green,dashed]->",
36+
"label": "The text can\nalso be on several lines\nand very long..."
37+
}
38+
},
39+
{
40+
"Action": {
41+
"label": "foo3"
42+
}
43+
},
44+
{
45+
"Else": {
46+
"label": null
47+
}
48+
},
49+
{
50+
"Arrow": {
51+
"syntax": "-[#black,dotted]->",
52+
"label": null
53+
}
54+
},
55+
{
56+
"Action": {
57+
"label": "foo4"
58+
}
59+
},
60+
{
61+
"EndIf": null
62+
},
63+
{
64+
"Arrow": {
65+
"syntax": "-[#gray,bold]->",
66+
"label": null
67+
}
68+
},
69+
{
70+
"Action": {
71+
"label": "foo5"
72+
}
73+
}
74+
]
75+
}
76+
}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
' *******************************************************************************
2+
' Copyright (c) 2026 Contributors to the Eclipse Foundation
3+
'
4+
' See the NOTICE file(s) distributed with this work for additional
5+
' information regarding copyright ownership.
6+
'
7+
' This program and the accompanying materials are made available under the
8+
' terms of the Apache License Version 2.0 which is available at
9+
' https://www.apache.org/licenses/LICENSE-2.0
10+
'
11+
' SPDX-License-Identifier: Apache-2.0
12+
' *******************************************************************************
13+
@startuml color
14+
15+
#YellowGreen:Hello Activity Diagram;
16+
17+
@enduml
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"color.puml": {
3+
"name": "color",
4+
"statements": [
5+
{
6+
"Action": {
7+
"label": "Hello Activity Diagram"
8+
}
9+
}
10+
]
11+
}
12+
}

0 commit comments

Comments
 (0)