@likec4/language-server 1.17.1 → 1.19.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/contrib/likec4.tmLanguage.json +1 -1
- package/dist/LikeC4FileSystem.d.ts +13 -0
- package/dist/LikeC4FileSystem.js +27 -0
- package/dist/Rpc.d.ts +9 -0
- package/dist/Rpc.js +126 -0
- package/dist/ast.d.ts +200 -0
- package/dist/ast.js +276 -0
- package/dist/browser.d.ts +6 -20
- package/dist/browser.js +13 -0
- package/dist/formatting/LikeC4Formatter.d.ts +27 -0
- package/dist/formatting/LikeC4Formatter.js +261 -0
- package/dist/formatting/utils.d.ts +6 -0
- package/dist/formatting/utils.js +15 -0
- package/dist/generated/ast.d.ts +1242 -0
- package/dist/generated/ast.js +1945 -0
- package/dist/generated/grammar.d.ts +6 -0
- package/dist/generated/grammar.js +3 -0
- package/dist/generated/module.d.ts +9 -0
- package/dist/generated/module.js +23 -0
- package/dist/generated-lib/icons.d.ts +1 -0
- package/dist/{likec4lib.mjs → generated-lib/icons.js} +1 -6
- package/dist/index.d.ts +8 -31
- package/dist/index.js +13 -0
- package/dist/like-c4.langium +845 -0
- package/dist/likec4lib.d.ts +4 -6
- package/dist/likec4lib.js +4 -0
- package/dist/logger.d.ts +7 -0
- package/dist/logger.js +73 -0
- package/dist/lsp/CodeLensProvider.d.ts +9 -0
- package/dist/lsp/CodeLensProvider.js +40 -0
- package/dist/lsp/CompletionProvider.d.ts +6 -0
- package/dist/lsp/CompletionProvider.js +135 -0
- package/dist/lsp/DocumentHighlightProvider.d.ts +9 -0
- package/dist/lsp/DocumentHighlightProvider.js +10 -0
- package/dist/lsp/DocumentLinkProvider.d.ts +11 -0
- package/dist/lsp/DocumentLinkProvider.js +49 -0
- package/dist/lsp/DocumentSymbolProvider.d.ts +23 -0
- package/dist/lsp/DocumentSymbolProvider.js +202 -0
- package/dist/lsp/HoverProvider.d.ts +10 -0
- package/dist/lsp/HoverProvider.js +69 -0
- package/dist/lsp/RenameProvider.d.ts +5 -0
- package/dist/lsp/RenameProvider.js +6 -0
- package/dist/lsp/SemanticTokenProvider.d.ts +7 -0
- package/dist/lsp/SemanticTokenProvider.js +297 -0
- package/dist/lsp/index.d.ts +7 -0
- package/dist/lsp/index.js +7 -0
- package/dist/model/deployments-index.d.ts +60 -0
- package/dist/model/deployments-index.js +181 -0
- package/dist/model/fqn-computation.d.ts +3 -0
- package/dist/model/fqn-computation.js +72 -0
- package/dist/model/fqn-index.d.ts +25 -0
- package/dist/model/fqn-index.js +96 -0
- package/dist/model/index.d.ts +6 -0
- package/dist/model/index.js +6 -0
- package/dist/model/model-builder.d.ts +32 -0
- package/dist/model/model-builder.js +598 -0
- package/dist/model/model-locator.d.ts +23 -0
- package/dist/model/model-locator.js +126 -0
- package/dist/model/model-parser-where.d.ts +3 -0
- package/dist/model/model-parser-where.js +70 -0
- package/dist/model/model-parser.d.ts +292 -0
- package/dist/model/model-parser.js +72 -0
- package/dist/model/parser/Base.d.ts +28 -0
- package/dist/model/parser/Base.js +87 -0
- package/dist/model/parser/DeploymentModelParser.d.ts +33 -0
- package/dist/model/parser/DeploymentModelParser.js +162 -0
- package/dist/model/parser/DeploymentViewParser.d.ts +38 -0
- package/dist/model/parser/DeploymentViewParser.js +98 -0
- package/dist/model/parser/FqnRefParser.d.ts +29 -0
- package/dist/model/parser/FqnRefParser.js +108 -0
- package/dist/model/parser/GlobalsParser.d.ts +66 -0
- package/dist/model/parser/GlobalsParser.js +80 -0
- package/dist/model/parser/ModelParser.d.ts +27 -0
- package/dist/model/parser/ModelParser.js +122 -0
- package/dist/model/parser/PredicatesParser.d.ts +34 -0
- package/dist/model/parser/PredicatesParser.js +272 -0
- package/dist/model/parser/SpecificationParser.d.ts +27 -0
- package/dist/model/parser/SpecificationParser.js +120 -0
- package/dist/model/parser/ViewsParser.d.ts +64 -0
- package/dist/model/parser/ViewsParser.js +377 -0
- package/dist/model-change/ModelChanges.d.ts +15 -0
- package/dist/model-change/ModelChanges.js +89 -0
- package/dist/model-change/changeElementStyle.d.ts +16 -0
- package/dist/model-change/changeElementStyle.js +136 -0
- package/dist/model-change/changeViewLayout.d.ts +12 -0
- package/dist/model-change/changeViewLayout.js +32 -0
- package/dist/model-change/saveManualLayout.d.ts +11 -0
- package/dist/model-change/saveManualLayout.js +27 -0
- package/dist/module.d.ts +62 -0
- package/dist/module.js +123 -0
- package/dist/protocol.d.ts +27 -27
- package/dist/protocol.js +14 -0
- package/dist/references/index.d.ts +3 -0
- package/dist/references/index.js +3 -0
- package/dist/references/name-provider.d.ts +9 -0
- package/dist/references/name-provider.js +33 -0
- package/dist/references/scope-computation.d.ts +20 -0
- package/dist/references/scope-computation.js +281 -0
- package/dist/references/scope-provider.d.ts +16 -0
- package/dist/references/scope-provider.js +165 -0
- package/dist/shared/NodeKindProvider.d.ts +15 -0
- package/dist/shared/NodeKindProvider.js +108 -0
- package/dist/shared/WorkspaceManager.d.ts +18 -0
- package/dist/shared/WorkspaceManager.js +36 -0
- package/dist/shared/WorkspaceSymbolProvider.d.ts +3 -0
- package/dist/shared/WorkspaceSymbolProvider.js +3 -0
- package/dist/shared/index.d.ts +3 -0
- package/dist/shared/index.js +3 -0
- package/dist/test/index.d.ts +1 -0
- package/dist/test/index.js +1 -0
- package/dist/test/setup.d.ts +1 -0
- package/dist/test/setup.js +7 -0
- package/dist/test/testServices.d.ts +22 -0
- package/dist/test/testServices.js +119 -0
- package/dist/utils/elementRef.d.ts +11 -0
- package/dist/utils/elementRef.js +15 -0
- package/dist/utils/fqnRef.d.ts +8 -0
- package/dist/utils/fqnRef.js +46 -0
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/index.js +1 -0
- package/dist/utils/printDocs.d.ts +2 -0
- package/dist/utils/printDocs.js +1 -0
- package/dist/utils/stringHash.d.ts +1 -0
- package/dist/utils/stringHash.js +5 -0
- package/dist/validation/_shared.d.ts +3 -0
- package/dist/validation/_shared.js +22 -0
- package/dist/validation/deployment-checks.d.ts +6 -0
- package/dist/validation/deployment-checks.js +114 -0
- package/dist/validation/dynamic-view-rule.d.ts +4 -0
- package/dist/validation/dynamic-view-rule.js +16 -0
- package/dist/validation/dynamic-view-step.d.ts +4 -0
- package/dist/validation/dynamic-view-step.js +33 -0
- package/dist/validation/element.d.ts +4 -0
- package/dist/validation/element.js +49 -0
- package/dist/validation/index.d.ts +15 -0
- package/dist/validation/index.js +152 -0
- package/dist/validation/property-checks.d.ts +6 -0
- package/dist/validation/property-checks.js +38 -0
- package/dist/validation/relation.d.ts +5 -0
- package/dist/validation/relation.js +56 -0
- package/dist/validation/specification.d.ts +11 -0
- package/dist/validation/specification.js +136 -0
- package/dist/validation/view-predicates/element-with.d.ts +4 -0
- package/dist/validation/view-predicates/element-with.js +30 -0
- package/dist/validation/view-predicates/expanded-element.d.ts +4 -0
- package/dist/validation/view-predicates/expanded-element.js +11 -0
- package/dist/validation/view-predicates/expression-v2.d.ts +5 -0
- package/dist/validation/view-predicates/expression-v2.js +83 -0
- package/dist/validation/view-predicates/incoming.d.ts +4 -0
- package/dist/validation/view-predicates/incoming.js +15 -0
- package/dist/validation/view-predicates/index.d.ts +6 -0
- package/dist/validation/view-predicates/index.js +6 -0
- package/dist/validation/view-predicates/outgoing.d.ts +4 -0
- package/dist/validation/view-predicates/outgoing.js +15 -0
- package/dist/validation/view-predicates/relation-with.d.ts +4 -0
- package/dist/validation/view-predicates/relation-with.js +12 -0
- package/dist/validation/view.d.ts +4 -0
- package/dist/validation/view.js +23 -0
- package/dist/view-utils/assignNavigateTo.d.ts +2 -0
- package/dist/view-utils/assignNavigateTo.js +25 -0
- package/dist/view-utils/index.d.ts +2 -0
- package/dist/view-utils/index.js +2 -0
- package/dist/view-utils/manual-layout.d.ts +7 -0
- package/dist/view-utils/manual-layout.js +99 -0
- package/dist/view-utils/resolve-relative-paths.d.ts +2 -0
- package/dist/view-utils/resolve-relative-paths.js +78 -0
- package/package.json +42 -73
- package/src/LikeC4FileSystem.ts +22 -21
- package/src/Rpc.ts +6 -3
- package/src/ast.ts +136 -172
- package/src/browser.ts +10 -11
- package/src/generated/ast.ts +656 -40
- package/src/generated/grammar.ts +1 -1
- package/src/index.ts +11 -8
- package/src/like-c4.langium +173 -22
- package/src/logger.ts +41 -57
- package/src/lsp/CodeLensProvider.ts +0 -1
- package/src/lsp/CompletionProvider.ts +20 -5
- package/src/lsp/DocumentSymbolProvider.ts +5 -2
- package/src/lsp/HoverProvider.ts +37 -3
- package/src/lsp/SemanticTokenProvider.ts +58 -32
- package/src/model/deployments-index.ts +222 -0
- package/src/model/fqn-computation.ts +1 -1
- package/src/model/fqn-index.ts +0 -1
- package/src/model/index.ts +1 -0
- package/src/model/model-builder.ts +176 -39
- package/src/model/model-locator.ts +36 -7
- package/src/model/model-parser.ts +69 -1119
- package/src/model/parser/Base.ts +107 -0
- package/src/model/parser/DeploymentModelParser.ts +192 -0
- package/src/model/parser/DeploymentViewParser.ts +116 -0
- package/src/model/parser/FqnRefParser.ts +118 -0
- package/src/model/parser/GlobalsParser.ts +96 -0
- package/src/model/parser/ModelParser.ts +141 -0
- package/src/model/parser/PredicatesParser.ts +291 -0
- package/src/model/parser/SpecificationParser.ts +133 -0
- package/src/model/parser/ViewsParser.ts +428 -0
- package/src/model-change/changeViewLayout.ts +2 -2
- package/src/module.ts +26 -21
- package/src/protocol.ts +10 -6
- package/src/references/index.ts +1 -0
- package/src/references/name-provider.ts +37 -0
- package/src/references/scope-computation.ts +130 -21
- package/src/references/scope-provider.ts +68 -35
- package/src/shared/NodeKindProvider.ts +15 -3
- package/src/{elementRef.ts → utils/elementRef.ts} +1 -1
- package/src/utils/fqnRef.ts +56 -0
- package/src/utils/stringHash.ts +2 -2
- package/src/validation/_shared.ts +6 -5
- package/src/validation/deployment-checks.ts +131 -0
- package/src/validation/dynamic-view-step.ts +1 -1
- package/src/validation/index.ts +104 -6
- package/src/validation/relation.ts +1 -1
- package/src/validation/view-predicates/expression-v2.ts +101 -0
- package/src/validation/view-predicates/index.ts +1 -0
- package/src/view-utils/assignNavigateTo.ts +6 -5
- package/src/view-utils/index.ts +0 -1
- package/src/view-utils/manual-layout.ts +25 -0
- package/dist/browser.cjs +0 -25
- package/dist/browser.d.cts +0 -23
- package/dist/browser.d.mts +0 -23
- package/dist/browser.mjs +0 -20
- package/dist/index.cjs +0 -53
- package/dist/index.d.cts +0 -34
- package/dist/index.d.mts +0 -34
- package/dist/index.mjs +0 -46
- package/dist/likec4lib.cjs +0 -1546
- package/dist/likec4lib.d.cts +0 -6
- package/dist/likec4lib.d.mts +0 -6
- package/dist/model-graph/index.cjs +0 -10
- package/dist/model-graph/index.d.cts +0 -81
- package/dist/model-graph/index.d.mts +0 -81
- package/dist/model-graph/index.d.ts +0 -81
- package/dist/model-graph/index.mjs +0 -1
- package/dist/protocol.cjs +0 -25
- package/dist/protocol.d.cts +0 -45
- package/dist/protocol.d.mts +0 -45
- package/dist/protocol.mjs +0 -17
- package/dist/shared/language-server.BIbAD1T-.mjs +0 -6292
- package/dist/shared/language-server.BQRvVmE0.d.cts +0 -1303
- package/dist/shared/language-server.BysPcTxr.d.ts +0 -1303
- package/dist/shared/language-server.D2QdbOJO.cjs +0 -1995
- package/dist/shared/language-server.DGrBGmsd.mjs +0 -1981
- package/dist/shared/language-server.DKV_FdPN.cjs +0 -6304
- package/dist/shared/language-server._wkyPgso.d.mts +0 -1303
- package/src/model-graph/LikeC4ModelGraph.ts +0 -338
- package/src/model-graph/compute-view/__test__/fixture.ts +0 -630
- package/src/model-graph/compute-view/compute.ts +0 -788
- package/src/model-graph/compute-view/index.ts +0 -33
- package/src/model-graph/compute-view/predicates.ts +0 -509
- package/src/model-graph/dynamic-view/__test__/fixture.ts +0 -61
- package/src/model-graph/dynamic-view/compute.ts +0 -313
- package/src/model-graph/dynamic-view/index.ts +0 -29
- package/src/model-graph/index.ts +0 -3
- package/src/model-graph/utils/applyCustomElementProperties.ts +0 -65
- package/src/model-graph/utils/applyCustomRelationProperties.ts +0 -41
- package/src/model-graph/utils/applyViewRuleStyles.ts +0 -49
- package/src/model-graph/utils/buildComputeNodes.ts +0 -113
- package/src/model-graph/utils/buildElementNotations.ts +0 -63
- package/src/model-graph/utils/elementExpressionToPredicate.ts +0 -39
- package/src/model-graph/utils/relationExpressionToPredicates.ts +0 -43
- package/src/model-graph/utils/sortNodes.ts +0 -105
- package/src/model-graph/utils/uniqueTags.test.ts +0 -42
- package/src/model-graph/utils/uniqueTags.ts +0 -19
- package/src/utils/graphlib.ts +0 -9
- package/src/view-utils/resolve-extended-views.ts +0 -66
- package/src/view-utils/resolve-global-rules.ts +0 -88
- package/src/view-utils/view-hash.ts +0 -27
|
@@ -0,0 +1,845 @@
|
|
|
1
|
+
grammar LikeC4
|
|
2
|
+
|
|
3
|
+
entry LikeC4Grammar:
|
|
4
|
+
(
|
|
5
|
+
specifications+=SpecificationRule |
|
|
6
|
+
models+=Model |
|
|
7
|
+
views+=ModelViews |
|
|
8
|
+
globals+=Globals |
|
|
9
|
+
deployments+=ModelDeployments |
|
|
10
|
+
likec4lib+=LikeC4Lib
|
|
11
|
+
)*
|
|
12
|
+
;
|
|
13
|
+
|
|
14
|
+
// Lib -------------------------------------
|
|
15
|
+
LikeC4Lib:
|
|
16
|
+
'likec4lib' '{'
|
|
17
|
+
'icons' '{'
|
|
18
|
+
(icons+=LibIcon)+
|
|
19
|
+
'}'
|
|
20
|
+
'}';
|
|
21
|
+
|
|
22
|
+
LibIcon: name=IconId;
|
|
23
|
+
|
|
24
|
+
// Specification -------------------------------------
|
|
25
|
+
|
|
26
|
+
ElementKind: name=Id;
|
|
27
|
+
Tag: name=Id;
|
|
28
|
+
RelationshipKind: name=Id;
|
|
29
|
+
CustomColor: name=CustomColorId;
|
|
30
|
+
DeploymentNodeKind: name=Id;
|
|
31
|
+
|
|
32
|
+
SpecificationRule:
|
|
33
|
+
name='specification' '{'
|
|
34
|
+
(
|
|
35
|
+
elements+=SpecificationElementKind |
|
|
36
|
+
tags+=SpecificationTag |
|
|
37
|
+
relationships+=SpecificationRelationshipKind |
|
|
38
|
+
colors+=SpecificationColor |
|
|
39
|
+
deploymentNodes+=SpecificationDeploymentNodeKind
|
|
40
|
+
)*
|
|
41
|
+
'}';
|
|
42
|
+
|
|
43
|
+
SpecificationElementKind:
|
|
44
|
+
'element' kind=ElementKind ('{'
|
|
45
|
+
props+=(
|
|
46
|
+
SpecificationElementStringProperty |
|
|
47
|
+
ElementStyleProperty
|
|
48
|
+
)*
|
|
49
|
+
'}')?;
|
|
50
|
+
|
|
51
|
+
SpecificationElementStringProperty:
|
|
52
|
+
key=('technology' | 'notation') ':'? value=String ';'?;
|
|
53
|
+
|
|
54
|
+
SpecificationDeploymentNodeKind:
|
|
55
|
+
'deploymentNode' kind=DeploymentNodeKind ('{'
|
|
56
|
+
props+=(
|
|
57
|
+
SpecificationElementStringProperty |
|
|
58
|
+
ElementStyleProperty
|
|
59
|
+
)*
|
|
60
|
+
'}')?;
|
|
61
|
+
|
|
62
|
+
SpecificationTag:
|
|
63
|
+
'tag' tag=Tag;
|
|
64
|
+
|
|
65
|
+
SpecificationColor:
|
|
66
|
+
'color' name=CustomColor color=CustomColorValue;
|
|
67
|
+
|
|
68
|
+
SpecificationRelationshipKind:
|
|
69
|
+
'relationship' kind=RelationshipKind ('{'
|
|
70
|
+
props+=(
|
|
71
|
+
RelationshipStyleProperty |
|
|
72
|
+
SpecificationRelationshipStringProperty
|
|
73
|
+
)*
|
|
74
|
+
'}')?
|
|
75
|
+
;
|
|
76
|
+
|
|
77
|
+
SpecificationRelationshipStringProperty:
|
|
78
|
+
key=('technology' | 'notation') ':'? value=String ';'?;
|
|
79
|
+
|
|
80
|
+
// Model -------------------------------------
|
|
81
|
+
|
|
82
|
+
Model:
|
|
83
|
+
name='model' '{'
|
|
84
|
+
elements+=(
|
|
85
|
+
ExtendElement |
|
|
86
|
+
Relation<true> |
|
|
87
|
+
Element
|
|
88
|
+
)*
|
|
89
|
+
'}'
|
|
90
|
+
;
|
|
91
|
+
|
|
92
|
+
Element:
|
|
93
|
+
(
|
|
94
|
+
kind=[ElementKind] name=Id |
|
|
95
|
+
name=Id Eq kind=[ElementKind]
|
|
96
|
+
)
|
|
97
|
+
(props+=String // title
|
|
98
|
+
(props+=String // description
|
|
99
|
+
(props+=String // technology
|
|
100
|
+
(props+=String)? // tags
|
|
101
|
+
)?
|
|
102
|
+
)?
|
|
103
|
+
)?
|
|
104
|
+
body=ElementBody?
|
|
105
|
+
;
|
|
106
|
+
|
|
107
|
+
ElementBody: '{'
|
|
108
|
+
tags=Tags?
|
|
109
|
+
props+=ElementProperty*
|
|
110
|
+
elements+=(
|
|
111
|
+
Relation<false> |
|
|
112
|
+
Element
|
|
113
|
+
)*
|
|
114
|
+
'}'
|
|
115
|
+
;
|
|
116
|
+
|
|
117
|
+
ElementProperty:
|
|
118
|
+
ElementStringProperty | ElementStyleProperty | LinkProperty | IconProperty | MetadataProperty;
|
|
119
|
+
|
|
120
|
+
ElementStringProperty:
|
|
121
|
+
key=('title' | 'technology' | 'description') ':'? value=String ';'?;
|
|
122
|
+
|
|
123
|
+
ExtendElement:
|
|
124
|
+
'extend' element=FqnElementRef body=ExtendElementBody
|
|
125
|
+
;
|
|
126
|
+
|
|
127
|
+
ExtendElementBody: '{'
|
|
128
|
+
elements+=(
|
|
129
|
+
Relation<true> |
|
|
130
|
+
Element
|
|
131
|
+
)*
|
|
132
|
+
'}'
|
|
133
|
+
;
|
|
134
|
+
|
|
135
|
+
//
|
|
136
|
+
FqnElementRef:
|
|
137
|
+
el=[Element:Id] ({infer FqnElementRef.parent=current} StickyDot el=[Element:Id])*;
|
|
138
|
+
|
|
139
|
+
ElementRef:
|
|
140
|
+
el=[Element:Id] ({infer ElementRef.parent=current} StickyDot el=[Element:Id])*;
|
|
141
|
+
|
|
142
|
+
Tags:
|
|
143
|
+
(values+=[Tag:TagId])+ ({infer Tags.prev=current} ',' (values+=[Tag:TagId])*)* ';'?
|
|
144
|
+
;
|
|
145
|
+
|
|
146
|
+
Relation<isExplicit>:
|
|
147
|
+
(<isExplicit> source=ElementRef | <!isExplicit> source=ElementRef?)
|
|
148
|
+
(
|
|
149
|
+
kind=[RelationshipKind:DotId] |
|
|
150
|
+
'-[' kind=[RelationshipKind] ']->' |
|
|
151
|
+
'->'
|
|
152
|
+
)
|
|
153
|
+
target=ElementRef
|
|
154
|
+
(
|
|
155
|
+
title=String
|
|
156
|
+
technology=String?
|
|
157
|
+
)?
|
|
158
|
+
tags=Tags?
|
|
159
|
+
body=RelationBody?
|
|
160
|
+
;
|
|
161
|
+
|
|
162
|
+
RelationBody: '{'
|
|
163
|
+
tags=Tags?
|
|
164
|
+
props+=RelationProperty*
|
|
165
|
+
'}'
|
|
166
|
+
;
|
|
167
|
+
|
|
168
|
+
RelationProperty:
|
|
169
|
+
RelationStringProperty |
|
|
170
|
+
RelationNavigateToProperty |
|
|
171
|
+
RelationStyleProperty |
|
|
172
|
+
LinkProperty |
|
|
173
|
+
MetadataProperty
|
|
174
|
+
;
|
|
175
|
+
|
|
176
|
+
RelationStringProperty:
|
|
177
|
+
key=('title' | 'technology' | 'description') ':'? value=String ';'?;
|
|
178
|
+
|
|
179
|
+
RelationStyleProperty:
|
|
180
|
+
key='style' '{'
|
|
181
|
+
props+=RelationshipStyleProperty*
|
|
182
|
+
'}'
|
|
183
|
+
;
|
|
184
|
+
|
|
185
|
+
MetadataProperty:
|
|
186
|
+
'metadata' MetadataBody
|
|
187
|
+
;
|
|
188
|
+
|
|
189
|
+
MetadataBody: '{'
|
|
190
|
+
props+=(MetadataAttribute)*
|
|
191
|
+
'}'
|
|
192
|
+
;
|
|
193
|
+
|
|
194
|
+
MetadataAttribute:
|
|
195
|
+
key=IdTerminal ':'? value=String ';'?
|
|
196
|
+
;
|
|
197
|
+
|
|
198
|
+
// Views -------------------------------------
|
|
199
|
+
|
|
200
|
+
ModelViews:
|
|
201
|
+
name='views' '{' (
|
|
202
|
+
views+=LikeC4ViewRule |
|
|
203
|
+
styles+=ViewRuleStyleOrGlobalRef
|
|
204
|
+
)*
|
|
205
|
+
'}';
|
|
206
|
+
|
|
207
|
+
type LikeC4View = ElementView | DynamicView | DeploymentView;
|
|
208
|
+
LikeC4ViewRule returns LikeC4View:
|
|
209
|
+
ElementView | DynamicView | DeploymentView;
|
|
210
|
+
|
|
211
|
+
ElementView:
|
|
212
|
+
'view' name=Id? (
|
|
213
|
+
'extends' extends=ElementViewRef |
|
|
214
|
+
'of' viewOf=ElementRef
|
|
215
|
+
)?
|
|
216
|
+
body=ElementViewBody?
|
|
217
|
+
;
|
|
218
|
+
|
|
219
|
+
DynamicView:
|
|
220
|
+
'dynamic' 'view' name=Id body=DynamicViewBody?
|
|
221
|
+
;
|
|
222
|
+
|
|
223
|
+
ViewRef:
|
|
224
|
+
view=[LikeC4View];
|
|
225
|
+
|
|
226
|
+
ElementViewRef:
|
|
227
|
+
view=[ElementView];
|
|
228
|
+
|
|
229
|
+
DynamicViewRef:
|
|
230
|
+
view=[DynamicView];
|
|
231
|
+
|
|
232
|
+
ElementViewBody: '{'
|
|
233
|
+
tags=Tags?
|
|
234
|
+
props+=ViewProperty*
|
|
235
|
+
rules+=ViewRule*
|
|
236
|
+
'}'
|
|
237
|
+
;
|
|
238
|
+
|
|
239
|
+
DynamicViewBody: '{'
|
|
240
|
+
tags=Tags?
|
|
241
|
+
props+=ViewProperty*
|
|
242
|
+
(
|
|
243
|
+
steps+=(DynamicViewParallelSteps | DynamicViewStep) |
|
|
244
|
+
rules+=DynamicViewRule
|
|
245
|
+
)*
|
|
246
|
+
'}'
|
|
247
|
+
;
|
|
248
|
+
|
|
249
|
+
|
|
250
|
+
type StringProperty =
|
|
251
|
+
ElementStringProperty |
|
|
252
|
+
ViewStringProperty |
|
|
253
|
+
RelationStringProperty |
|
|
254
|
+
MetadataAttribute |
|
|
255
|
+
SpecificationElementStringProperty |
|
|
256
|
+
SpecificationRelationshipStringProperty |
|
|
257
|
+
NotationProperty |
|
|
258
|
+
NotesProperty
|
|
259
|
+
;
|
|
260
|
+
|
|
261
|
+
ViewProperty:
|
|
262
|
+
ViewStringProperty | LinkProperty
|
|
263
|
+
;
|
|
264
|
+
|
|
265
|
+
ViewStringProperty:
|
|
266
|
+
key=('title' | 'description') ':'? value=String ';'?;
|
|
267
|
+
|
|
268
|
+
ViewLayoutDirection returns string:
|
|
269
|
+
'TopBottom' | 'LeftRight' | 'BottomTop' | 'RightLeft';
|
|
270
|
+
|
|
271
|
+
ViewRule:
|
|
272
|
+
ViewRulePredicate |
|
|
273
|
+
ViewRuleGlobalPredicateRef |
|
|
274
|
+
ViewRuleGroup |
|
|
275
|
+
ViewRuleStyleOrGlobalRef |
|
|
276
|
+
ViewRuleAutoLayout
|
|
277
|
+
;
|
|
278
|
+
|
|
279
|
+
ViewRuleGroup:
|
|
280
|
+
'group' title=String? '{'
|
|
281
|
+
props+=(
|
|
282
|
+
ColorProperty |
|
|
283
|
+
BorderProperty |
|
|
284
|
+
OpacityProperty
|
|
285
|
+
)*
|
|
286
|
+
groupRules+=(
|
|
287
|
+
ViewRulePredicate |
|
|
288
|
+
ViewRuleGroup
|
|
289
|
+
)*
|
|
290
|
+
'}';
|
|
291
|
+
|
|
292
|
+
DynamicViewRule:
|
|
293
|
+
DynamicViewIncludePredicate |
|
|
294
|
+
DynamicViewGlobalPredicateRef |
|
|
295
|
+
ViewRuleStyleOrGlobalRef |
|
|
296
|
+
ViewRuleAutoLayout
|
|
297
|
+
;
|
|
298
|
+
|
|
299
|
+
DynamicViewParallelSteps:
|
|
300
|
+
('parallel'|'par') '{'
|
|
301
|
+
(steps+=DynamicViewStep)*
|
|
302
|
+
'}'
|
|
303
|
+
;
|
|
304
|
+
|
|
305
|
+
DynamicViewStep:
|
|
306
|
+
source=ElementRef
|
|
307
|
+
(isBackward?='<-' | '->' | '-[' kind=[RelationshipKind] ']->' | kind=[RelationshipKind:DotId] )
|
|
308
|
+
target=ElementRef
|
|
309
|
+
title=String?
|
|
310
|
+
custom=CustomRelationProperties?
|
|
311
|
+
;
|
|
312
|
+
|
|
313
|
+
ViewRulePredicate:
|
|
314
|
+
{infer IncludePredicate} 'include' predicates=Predicates |
|
|
315
|
+
{infer ExcludePredicate} 'exclude' predicates=Predicates
|
|
316
|
+
;
|
|
317
|
+
Predicates:
|
|
318
|
+
value=Predicate ({infer Predicates.prev=current} ',' value=Predicate?)*
|
|
319
|
+
;
|
|
320
|
+
|
|
321
|
+
Predicate:
|
|
322
|
+
RelationPredicate |
|
|
323
|
+
ElementPredicate
|
|
324
|
+
;
|
|
325
|
+
|
|
326
|
+
ViewRuleGlobalPredicateRef:
|
|
327
|
+
'global' 'predicate' predicate=[GlobalPredicateGroup];
|
|
328
|
+
|
|
329
|
+
ElementPredicate:
|
|
330
|
+
ElementPredicates;
|
|
331
|
+
|
|
332
|
+
ElementPredicates infers ElementPredicate:
|
|
333
|
+
ElementPredicateOrWhere ({infer ElementPredicateWith.subject=current} 'with' custom=CustomElementProperties?)?
|
|
334
|
+
;
|
|
335
|
+
|
|
336
|
+
ElementPredicateOrWhere:
|
|
337
|
+
ElementExpression ({infer ElementPredicateWhere.subject=current} 'where' where=WhereElementExpression?)?
|
|
338
|
+
;
|
|
339
|
+
|
|
340
|
+
WhereElementExpression:
|
|
341
|
+
WhereElementOr
|
|
342
|
+
;
|
|
343
|
+
WhereElementOr infers WhereElementExpression:
|
|
344
|
+
WhereElementAnd ({infer WhereBinaryExpression.left=current} operator='or' right=WhereElementAnd)*
|
|
345
|
+
;
|
|
346
|
+
WhereElementAnd infers WhereElementExpression:
|
|
347
|
+
WhereElementPrimary ({infer WhereBinaryExpression.left=current} operator='and' right=WhereElementPrimary)*
|
|
348
|
+
;
|
|
349
|
+
|
|
350
|
+
WhereElementPrimary infers WhereElementExpression:
|
|
351
|
+
'(' WhereElementExpression ')' |
|
|
352
|
+
WhereElementNegation |
|
|
353
|
+
WhereElement
|
|
354
|
+
;
|
|
355
|
+
|
|
356
|
+
WhereElementNegation:
|
|
357
|
+
'not' value=WhereElementExpression;
|
|
358
|
+
|
|
359
|
+
WhereElement:
|
|
360
|
+
{infer WhereElementTag} 'tag' EqOperator value=[Tag:TagId]? |
|
|
361
|
+
{infer WhereElementKind} 'kind' EqOperator value=[ElementKind]?
|
|
362
|
+
;
|
|
363
|
+
|
|
364
|
+
ElementExpression:
|
|
365
|
+
ElementSelectorExpression |
|
|
366
|
+
ElementDescedantsExpression
|
|
367
|
+
;
|
|
368
|
+
|
|
369
|
+
ElementSelectorExpression infers ElementExpression:
|
|
370
|
+
{infer WildcardExpression} isWildcard?='*' |
|
|
371
|
+
{infer ElementTagExpression} 'element.tag' IsEqual tag=[Tag:TagId]? |
|
|
372
|
+
{infer ElementKindExpression} 'element.kind' IsEqual kind=[ElementKind]?
|
|
373
|
+
;
|
|
374
|
+
|
|
375
|
+
ElementDescedantsExpression infers ElementExpression:
|
|
376
|
+
ElementRef (
|
|
377
|
+
{infer ExpandElementExpression.expand=current} DotUnderscore |
|
|
378
|
+
{infer ElementDescedantsExpression.parent=current} suffix=DotWildcard
|
|
379
|
+
)?
|
|
380
|
+
;
|
|
381
|
+
|
|
382
|
+
RelationPredicate:
|
|
383
|
+
RelationPredicates
|
|
384
|
+
;
|
|
385
|
+
|
|
386
|
+
RelationPredicates infers RelationPredicate:
|
|
387
|
+
RelationPredicateOrWhere ({infer RelationPredicateWith.subject=current} 'with' custom=CustomRelationProperties?)?
|
|
388
|
+
;
|
|
389
|
+
|
|
390
|
+
RelationPredicateOrWhere:
|
|
391
|
+
RelationExpression ({infer RelationPredicateWhere.subject=current} 'where' where=WhereRelationExpression?)?
|
|
392
|
+
;
|
|
393
|
+
|
|
394
|
+
WhereRelationExpression:
|
|
395
|
+
WhereRelationOr
|
|
396
|
+
;
|
|
397
|
+
|
|
398
|
+
WhereRelationOr infers WhereRelationExpression:
|
|
399
|
+
WhereRelationAnd ({infer WhereBinaryExpression.left=current} operator='or' right=WhereRelationAnd)*
|
|
400
|
+
;
|
|
401
|
+
WhereRelationAnd infers WhereRelationExpression:
|
|
402
|
+
WhereRelationPrimary ({infer WhereBinaryExpression.left=current} operator='and' right=WhereRelationPrimary)*
|
|
403
|
+
;
|
|
404
|
+
|
|
405
|
+
WhereRelationPrimary infers WhereRelationExpression:
|
|
406
|
+
'(' WhereRelationExpression ')' |
|
|
407
|
+
WhereRelationNegation |
|
|
408
|
+
WhereRelation
|
|
409
|
+
;
|
|
410
|
+
|
|
411
|
+
WhereRelationNegation:
|
|
412
|
+
'not' value=WhereRelationExpression;
|
|
413
|
+
|
|
414
|
+
WhereRelation:
|
|
415
|
+
{infer WhereRelationTag} 'tag' EqOperator value=[Tag:TagId]? |
|
|
416
|
+
{infer WhereRelationKind} 'kind' EqOperator value=[RelationshipKind:Id]?
|
|
417
|
+
;
|
|
418
|
+
|
|
419
|
+
type WhereTagEqual = WhereElementTag | WhereRelationTag;
|
|
420
|
+
type WhereKindEqual = WhereElementKind | WhereRelationKind;
|
|
421
|
+
|
|
422
|
+
type WhereExpression = WhereElementExpression | WhereRelationExpression;
|
|
423
|
+
|
|
424
|
+
RelationExpression:
|
|
425
|
+
InOutRelationExpressions |
|
|
426
|
+
DirectedRelationExpressions
|
|
427
|
+
;
|
|
428
|
+
|
|
429
|
+
InOutRelationExpressions infers RelationExpression:
|
|
430
|
+
IncomingRelationExpression ({infer InOutRelationExpression.inout=current} '->')?
|
|
431
|
+
;
|
|
432
|
+
|
|
433
|
+
IncomingRelationExpression:
|
|
434
|
+
'->' to=ElementExpression;
|
|
435
|
+
|
|
436
|
+
DirectedRelationExpressions infers RelationExpression:
|
|
437
|
+
OutgoingRelationExpression ({infer DirectedRelationExpression.source=current} target=ElementExpression)?
|
|
438
|
+
;
|
|
439
|
+
|
|
440
|
+
OutgoingRelationExpression:
|
|
441
|
+
from=ElementExpression
|
|
442
|
+
(isBidirectional?='<->' | '->' | '-[' kind=[RelationshipKind:Id] ']->' | kind=[RelationshipKind:DotId])
|
|
443
|
+
;
|
|
444
|
+
|
|
445
|
+
// Comma-separated list of ElementExpressions
|
|
446
|
+
ElementExpressionsIterator:
|
|
447
|
+
value=ElementExpression ({infer ElementExpressionsIterator.prev=current} ',' (value=ElementExpression)?)*
|
|
448
|
+
;
|
|
449
|
+
|
|
450
|
+
DynamicViewIncludePredicate:
|
|
451
|
+
'include' predicates=DynamicViewPredicateIterator
|
|
452
|
+
;
|
|
453
|
+
|
|
454
|
+
DynamicViewGlobalPredicateRef:
|
|
455
|
+
'global' 'predicate' predicate=[GlobalDynamicPredicateGroup];
|
|
456
|
+
|
|
457
|
+
DynamicViewPredicateIterator:
|
|
458
|
+
value=ElementPredicate ({infer DynamicViewPredicateIterator.prev=current} ',' (value=ElementPredicate)?)*
|
|
459
|
+
;
|
|
460
|
+
|
|
461
|
+
ViewRuleStyle:
|
|
462
|
+
'style' target=ElementExpressionsIterator '{'
|
|
463
|
+
props+=(
|
|
464
|
+
StyleProperty |
|
|
465
|
+
NotationProperty
|
|
466
|
+
)*
|
|
467
|
+
'}';
|
|
468
|
+
|
|
469
|
+
ViewRuleGlobalStyle:
|
|
470
|
+
'global' 'style' style=[GlobalStyleId];
|
|
471
|
+
|
|
472
|
+
ViewRuleStyleOrGlobalRef:
|
|
473
|
+
ViewRuleStyle | ViewRuleGlobalStyle;
|
|
474
|
+
|
|
475
|
+
ViewRuleAutoLayout:
|
|
476
|
+
'autoLayout' direction=ViewLayoutDirection (
|
|
477
|
+
rankSep=Number (
|
|
478
|
+
nodeSep=Number)?
|
|
479
|
+
)?;
|
|
480
|
+
|
|
481
|
+
NotationProperty:
|
|
482
|
+
key='notation' ':'? value=String ';'?
|
|
483
|
+
;
|
|
484
|
+
NotesProperty:
|
|
485
|
+
key='notes' ':'? value=String ';'?
|
|
486
|
+
;
|
|
487
|
+
|
|
488
|
+
CustomElementProperties: '{'
|
|
489
|
+
props+=(
|
|
490
|
+
NavigateToProperty |
|
|
491
|
+
ElementStringProperty |
|
|
492
|
+
NotationProperty |
|
|
493
|
+
StyleProperty
|
|
494
|
+
)*
|
|
495
|
+
'}'
|
|
496
|
+
;
|
|
497
|
+
|
|
498
|
+
CustomRelationProperties: '{'
|
|
499
|
+
props+=(
|
|
500
|
+
RelationNavigateToProperty |
|
|
501
|
+
RelationStringProperty |
|
|
502
|
+
NotationProperty |
|
|
503
|
+
NotesProperty |
|
|
504
|
+
RelationshipStyleProperty
|
|
505
|
+
)*
|
|
506
|
+
'}'
|
|
507
|
+
;
|
|
508
|
+
|
|
509
|
+
NavigateToProperty:
|
|
510
|
+
key='navigateTo' value=ViewRef;
|
|
511
|
+
|
|
512
|
+
RelationNavigateToProperty:
|
|
513
|
+
key='navigateTo' value=DynamicViewRef;
|
|
514
|
+
|
|
515
|
+
// Deployment -------------------------------------
|
|
516
|
+
|
|
517
|
+
ModelDeployments:
|
|
518
|
+
name='deployment' '{'
|
|
519
|
+
elements+=(
|
|
520
|
+
DeploymentNode |
|
|
521
|
+
DeploymentRelation
|
|
522
|
+
)*
|
|
523
|
+
'}';
|
|
524
|
+
|
|
525
|
+
type DeploymentElement = DeploymentNode | DeployedInstance;
|
|
526
|
+
|
|
527
|
+
DeploymentNode:
|
|
528
|
+
(
|
|
529
|
+
kind=[DeploymentNodeKind:Id] name=Id |
|
|
530
|
+
name=Id Eq kind=[DeploymentNodeKind:Id]
|
|
531
|
+
)
|
|
532
|
+
title=String?
|
|
533
|
+
body=DeploymentNodeBody?
|
|
534
|
+
;
|
|
535
|
+
|
|
536
|
+
DeploymentNodeBody: '{'
|
|
537
|
+
tags=Tags?
|
|
538
|
+
props+=ElementProperty*
|
|
539
|
+
elements+=(
|
|
540
|
+
DeployedInstance |
|
|
541
|
+
DeploymentRelation |
|
|
542
|
+
DeploymentNode
|
|
543
|
+
)*
|
|
544
|
+
'}';
|
|
545
|
+
|
|
546
|
+
DeployedInstance:
|
|
547
|
+
(name=Id Eq)?
|
|
548
|
+
'instanceOf'
|
|
549
|
+
element=ElementRef
|
|
550
|
+
title=String?
|
|
551
|
+
body=DeployedInstanceBody?
|
|
552
|
+
';'?
|
|
553
|
+
;
|
|
554
|
+
|
|
555
|
+
DeployedInstanceBody: '{'
|
|
556
|
+
tags=Tags?
|
|
557
|
+
props+=ElementProperty*
|
|
558
|
+
'}';
|
|
559
|
+
|
|
560
|
+
type Referenceable = DeploymentNode | DeployedInstance | Element;
|
|
561
|
+
// Reference to Elements in logical or deployment model
|
|
562
|
+
// Scope computation is based on the parent element:
|
|
563
|
+
// - If parent is DeploymentNode, then it can reference nested DeploymentNodes and DeployedInstances
|
|
564
|
+
// - If parent is DeployedInstance, then it can reference nested Element
|
|
565
|
+
// - If parent is Element, then it can reference nested Element
|
|
566
|
+
// Mix of DeploymentRef and ElementRef
|
|
567
|
+
FqnRef:
|
|
568
|
+
value=[Referenceable:Id] ({infer FqnRef.parent=current} StickyDot value=[Referenceable:Id])*;
|
|
569
|
+
|
|
570
|
+
DeploymentRelation:
|
|
571
|
+
source=FqnRef
|
|
572
|
+
('->' | '-[' kind=[RelationshipKind:Id] ']->' | kind=[RelationshipKind:DotId])
|
|
573
|
+
target=FqnRef
|
|
574
|
+
(
|
|
575
|
+
title=String
|
|
576
|
+
technology=String?
|
|
577
|
+
)?
|
|
578
|
+
tags=Tags?
|
|
579
|
+
body=DeploymentRelationBody?
|
|
580
|
+
;
|
|
581
|
+
|
|
582
|
+
DeploymentRelationBody: '{'
|
|
583
|
+
tags=Tags?
|
|
584
|
+
props+=RelationProperty*
|
|
585
|
+
'}'
|
|
586
|
+
;
|
|
587
|
+
|
|
588
|
+
DeploymentView:
|
|
589
|
+
'deployment' 'view' name=Id body=DeploymentViewBody?
|
|
590
|
+
;
|
|
591
|
+
|
|
592
|
+
DeploymentViewBody: '{'
|
|
593
|
+
tags=Tags?
|
|
594
|
+
props+=ViewProperty*
|
|
595
|
+
rules+=DeploymentViewRule*
|
|
596
|
+
'}';
|
|
597
|
+
|
|
598
|
+
DeploymentViewRule:
|
|
599
|
+
DeploymentViewRulePredicate |
|
|
600
|
+
DeploymentViewRuleStyle |
|
|
601
|
+
ViewRuleAutoLayout
|
|
602
|
+
;
|
|
603
|
+
|
|
604
|
+
DeploymentViewRuleStyle:
|
|
605
|
+
'style' targets=FqnExpressions '{'
|
|
606
|
+
props+=(
|
|
607
|
+
StyleProperty |
|
|
608
|
+
NotationProperty
|
|
609
|
+
)*
|
|
610
|
+
'}';
|
|
611
|
+
|
|
612
|
+
|
|
613
|
+
DeploymentViewRulePredicate:
|
|
614
|
+
(isInclude?='include' | 'exclude')
|
|
615
|
+
expr=DeploymentViewRulePredicateExpression
|
|
616
|
+
;
|
|
617
|
+
|
|
618
|
+
DeploymentViewRulePredicateExpression:
|
|
619
|
+
value=ExpressionV2 ({infer DeploymentViewRulePredicateExpression.prev=current} ',' (value=ExpressionV2)?)*
|
|
620
|
+
;
|
|
621
|
+
|
|
622
|
+
ExpressionV2:
|
|
623
|
+
RelationExpr |
|
|
624
|
+
FqnExpr
|
|
625
|
+
;
|
|
626
|
+
|
|
627
|
+
|
|
628
|
+
FqnExpr:
|
|
629
|
+
{infer WildcardExpression} isWildcard?='*' |
|
|
630
|
+
FqnRefExpr
|
|
631
|
+
;
|
|
632
|
+
|
|
633
|
+
FqnRefExpr:
|
|
634
|
+
ref=FqnRef selector=(DotUnderscore | DotWildcard)?
|
|
635
|
+
;
|
|
636
|
+
|
|
637
|
+
RelationExpr:
|
|
638
|
+
InOutRelationExpr |
|
|
639
|
+
DirectedRelationExpr
|
|
640
|
+
;
|
|
641
|
+
|
|
642
|
+
InOutRelationExpr infers RelationExpr:
|
|
643
|
+
IncomingRelationExpr ({infer InOutRelationExpr.inout=current} '->')?
|
|
644
|
+
;
|
|
645
|
+
|
|
646
|
+
IncomingRelationExpr:
|
|
647
|
+
'->' to=FqnExpr;
|
|
648
|
+
|
|
649
|
+
DirectedRelationExpr infers RelationExpr:
|
|
650
|
+
OutgoingRelationExpr ({infer DirectedRelationExpr.source=current} target=FqnExpr)?
|
|
651
|
+
;
|
|
652
|
+
|
|
653
|
+
OutgoingRelationExpr:
|
|
654
|
+
from=FqnExpr
|
|
655
|
+
(isBidirectional?='<->' | '->' | '-[' kind=[RelationshipKind:Id] ']->' | kind=[RelationshipKind:DotId])
|
|
656
|
+
;
|
|
657
|
+
|
|
658
|
+
FqnExpressions:
|
|
659
|
+
value=FqnExpr ({infer FqnExpressions.prev=current} ',' (value=FqnExpr)?)*
|
|
660
|
+
;
|
|
661
|
+
// Global -------------------------------------
|
|
662
|
+
|
|
663
|
+
Globals:
|
|
664
|
+
name='global' '{'
|
|
665
|
+
(
|
|
666
|
+
predicates+=(GlobalPredicateGroup | GlobalDynamicPredicateGroup)*
|
|
667
|
+
styles+=(GlobalStyle | GlobalStyleGroup)*
|
|
668
|
+
)*
|
|
669
|
+
'}';
|
|
670
|
+
|
|
671
|
+
GlobalPredicateGroup:
|
|
672
|
+
'predicateGroup' name=IdTerminal '{'
|
|
673
|
+
predicates+=ViewRulePredicate*
|
|
674
|
+
'}';
|
|
675
|
+
|
|
676
|
+
GlobalDynamicPredicateGroup:
|
|
677
|
+
'dynamicPredicateGroup' name=IdTerminal '{'
|
|
678
|
+
predicates+=DynamicViewIncludePredicate*
|
|
679
|
+
'}';
|
|
680
|
+
|
|
681
|
+
GlobalStyleId:
|
|
682
|
+
name=IdTerminal;
|
|
683
|
+
|
|
684
|
+
GlobalStyle:
|
|
685
|
+
'style' id=GlobalStyleId target=ElementExpressionsIterator '{'
|
|
686
|
+
props+=(
|
|
687
|
+
StyleProperty |
|
|
688
|
+
NotationProperty
|
|
689
|
+
)*
|
|
690
|
+
'}';
|
|
691
|
+
|
|
692
|
+
GlobalStyleGroup:
|
|
693
|
+
'styleGroup' id=GlobalStyleId '{'
|
|
694
|
+
styles+=ViewRuleStyle*
|
|
695
|
+
'}';
|
|
696
|
+
|
|
697
|
+
type FqnReferenceable = Referenceable | Element | ExtendElement;
|
|
698
|
+
|
|
699
|
+
// Common properties -------------------------------------
|
|
700
|
+
|
|
701
|
+
LinkProperty:
|
|
702
|
+
key='link' ':'? value=Uri title=String? ';'?;
|
|
703
|
+
ColorProperty:
|
|
704
|
+
key='color' ':'? (themeColor=ThemeColor | customColor=[CustomColor:CustomColorId]) ';'?;
|
|
705
|
+
|
|
706
|
+
OpacityProperty:
|
|
707
|
+
key='opacity' ':'? value=Percent ';'?;
|
|
708
|
+
|
|
709
|
+
// Element properties -------------------------------------
|
|
710
|
+
IconProperty:
|
|
711
|
+
key='icon' ':'? (libicon=[LibIcon:IconId] | value=('none'|Uri)) ';'?;
|
|
712
|
+
|
|
713
|
+
ShapeProperty:
|
|
714
|
+
key='shape' ':'? value=ElementShape ';'?;
|
|
715
|
+
|
|
716
|
+
|
|
717
|
+
BorderStyleValue returns string:
|
|
718
|
+
LineOptions | 'none';
|
|
719
|
+
|
|
720
|
+
BorderProperty:
|
|
721
|
+
key='border' ':'? value=BorderStyleValue ';'?;
|
|
722
|
+
|
|
723
|
+
StyleProperty:
|
|
724
|
+
ColorProperty |
|
|
725
|
+
ShapeProperty |
|
|
726
|
+
BorderProperty |
|
|
727
|
+
OpacityProperty |
|
|
728
|
+
IconProperty;
|
|
729
|
+
|
|
730
|
+
ElementStyleProperty:
|
|
731
|
+
key='style' '{'
|
|
732
|
+
props+=StyleProperty*
|
|
733
|
+
'}';
|
|
734
|
+
|
|
735
|
+
|
|
736
|
+
// -------------------------
|
|
737
|
+
// Relationship Style Properties
|
|
738
|
+
LineProperty:
|
|
739
|
+
key='line' ':'? value=LineOptions ';'?;
|
|
740
|
+
ArrowProperty:
|
|
741
|
+
key=('head' | 'tail') ':'? value=ArrowType ';'?;
|
|
742
|
+
|
|
743
|
+
RelationshipStyleProperty:
|
|
744
|
+
ColorProperty | LineProperty | ArrowProperty;
|
|
745
|
+
|
|
746
|
+
LineOptions returns string:
|
|
747
|
+
'solid' |
|
|
748
|
+
'dashed' |
|
|
749
|
+
'dotted'
|
|
750
|
+
;
|
|
751
|
+
|
|
752
|
+
ArrowType returns string:
|
|
753
|
+
'none' |
|
|
754
|
+
'normal' |
|
|
755
|
+
'onormal' |
|
|
756
|
+
'dot' |
|
|
757
|
+
'odot' |
|
|
758
|
+
'diamond' |
|
|
759
|
+
'odiamond' |
|
|
760
|
+
'crow' |
|
|
761
|
+
'open' |
|
|
762
|
+
'vee'
|
|
763
|
+
;
|
|
764
|
+
|
|
765
|
+
ThemeColor returns string:
|
|
766
|
+
'primary' | 'secondary' | 'muted' | 'slate' | 'blue' | 'indigo' | 'sky' | 'red' | 'gray' | 'green' | 'amber';
|
|
767
|
+
ElementShape returns string:
|
|
768
|
+
'rectangle' | 'person' | 'browser' | 'mobile' | 'cylinder' | 'storage' | 'queue';
|
|
769
|
+
|
|
770
|
+
CustomColorValue returns string:
|
|
771
|
+
Hash (Id | Hex | Number);
|
|
772
|
+
|
|
773
|
+
IconId returns string:
|
|
774
|
+
LIB_ICON;
|
|
775
|
+
|
|
776
|
+
Uri returns string:
|
|
777
|
+
URI_WITH_SCHEMA | URI_RELATIVE;
|
|
778
|
+
|
|
779
|
+
TagId returns string:
|
|
780
|
+
Hash Id;
|
|
781
|
+
|
|
782
|
+
DotId returns string:
|
|
783
|
+
Dot Id;
|
|
784
|
+
|
|
785
|
+
CustomColorId returns string:
|
|
786
|
+
IdTerminal | ElementShape | ArrowType | LineOptions | 'element' | 'model';
|
|
787
|
+
|
|
788
|
+
Id returns string:
|
|
789
|
+
IdTerminal | ElementShape | ThemeColor | ArrowType | LineOptions | 'element' | 'model' | 'group' | 'node' | 'deployment' | 'instance';
|
|
790
|
+
|
|
791
|
+
fragment EqOperator:
|
|
792
|
+
(
|
|
793
|
+
operator=(Eq | NotEqual) |
|
|
794
|
+
operator="is" not?='not'?
|
|
795
|
+
)
|
|
796
|
+
;
|
|
797
|
+
|
|
798
|
+
fragment IsEqual:
|
|
799
|
+
isEqual?=Eq | NotEqual;
|
|
800
|
+
|
|
801
|
+
// -----------------------------------
|
|
802
|
+
// Symbols
|
|
803
|
+
// terminal fragment HASH: '#';
|
|
804
|
+
// terminal fragment UNDERSCORE: '_';
|
|
805
|
+
// terminal fragment DASH: '-';
|
|
806
|
+
// terminal fragment LETTER: /[^\W\d_]/;
|
|
807
|
+
// terminal fragment DIGIT: /[0-9]/;
|
|
808
|
+
// terminal fragment NEWLINE: /[\r?\n]/;
|
|
809
|
+
// terminal fragment SPACE: /[^\S\r\n]/;
|
|
810
|
+
|
|
811
|
+
// -------------------------
|
|
812
|
+
// Comments
|
|
813
|
+
hidden terminal BLOCK_COMMENT: /\/\*[\s\S]*?\*\//;
|
|
814
|
+
hidden terminal LINE_COMMENT: /\/\/[^\n\r]*/;
|
|
815
|
+
hidden terminal WS: /[\t ]+/;
|
|
816
|
+
hidden terminal NL: /[\r\n]+/;
|
|
817
|
+
|
|
818
|
+
// -----------------------------------
|
|
819
|
+
// Terminals
|
|
820
|
+
//terminal LineStartWithDash: /(?<=([\r?\n][^\S\r\n]*))-/;
|
|
821
|
+
|
|
822
|
+
// LibIcons
|
|
823
|
+
terminal LIB_ICON: /(aws|azure|gcp|tech):[-\w]*/;
|
|
824
|
+
|
|
825
|
+
terminal URI_WITH_SCHEMA: /\w+:\/\/\S+/;
|
|
826
|
+
terminal URI_RELATIVE: /\.{0,2}\/[^\/]\S+/;
|
|
827
|
+
|
|
828
|
+
terminal DotUnderscore: /\b\._(?![_a-zA-Z])/;
|
|
829
|
+
terminal DotWildcard: /\b\.\*{1,2}/;
|
|
830
|
+
terminal Hash: '#';
|
|
831
|
+
|
|
832
|
+
// No space allowed before dot
|
|
833
|
+
terminal StickyDot: /\b\./;
|
|
834
|
+
terminal Dot: '.';
|
|
835
|
+
terminal NotEqual: /\!\={1,2}/;
|
|
836
|
+
terminal Eq: /\={1,2}/;
|
|
837
|
+
terminal Percent: /\b\d+%/;
|
|
838
|
+
|
|
839
|
+
terminal String: /"[^"]*"|'[^']*'/;
|
|
840
|
+
|
|
841
|
+
// terminal TagId: HASH LETTER (LETTER | DIGIT | UNDERSCORE | DASH)*;
|
|
842
|
+
// terminal IdTerminal: (LETTER | UNDERSCORE+ (LETTER | DIGIT)) (LETTER | DIGIT | UNDERSCORE | DASH)*;
|
|
843
|
+
terminal IdTerminal: /[_]*[a-zA-Z][-\w]*/;
|
|
844
|
+
terminal Number returns number: /\b\d+\b/;
|
|
845
|
+
terminal Hex: /\b[a-zA-Z0-9]+\b/;
|