Skip to content
This repository was archived by the owner on Jan 10, 2024. It is now read-only.

Commit ade15d7

Browse files
Initial commit of source code for the DSL parser.
1 parent ec3b063 commit ade15d7

File tree

97 files changed

+6806
-17
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

97 files changed

+6806
-17
lines changed

.gitignore

+5
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,8 @@
2121

2222
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
2323
hs_err_pid*
24+
25+
.gradle
26+
.idea
27+
build
28+
out

build.gradle

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
apply plugin: 'java'
2+
3+
repositories {
4+
mavenCentral()
5+
}
6+
7+
dependencies {
8+
compile 'com.structurizr:structurizr-client:1.4.3'
9+
10+
testCompile 'org.junit.jupiter:junit-jupiter-engine:5.6.2'
11+
}
12+
13+
compileJava.options.encoding = 'UTF-8'
14+
compileTestJava.options.encoding = 'UTF-8'
15+
16+
sourceCompatibility = 1.8
17+
targetCompatibility = 1.8
18+
19+
description = 'Structurizr DSL'
20+
group = 'com.structurizr'
21+
version = '1.0.0'
22+
23+
test {
24+
useJUnitPlatform()
25+
}

docs/language-reference.md

+15-15
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ See [https://structurizr.com/dsl](https://structurizr.com/dsl) for a demo of the
6666
- Opening curly brace symbols (```{```) must be on the same line (i.e. the last token of the statement, not on a line of their own).
6767
- Closing curly brace symbols (```}```) must be on a line of their own.
6868
- Use ```""``` as a placeholder for an earlier optional property that you'd like to skip.
69-
- Each view must have a unique "key".
69+
- Each view must have a unique "key" (this is autogenerated if not specified).
7070
- See [Structurizr - Notation](https://structurizr.com/help/notation) for details of how tags and styling works.
7171

7272
## Comments
@@ -179,42 +179,42 @@ workspace [name] [description] {
179179
180180
views {
181181
182-
systemLandscape <key> [description] {
182+
systemLandscape [key] [description] {
183183
include <*|identifier> [identifier...]
184184
exclude <identifier> [identifier...]
185185
autoLayout [tb|bt|lr|rl] [rankSeparation] [nodeSeparation]
186186
animationStep <identifier> [identifier...]
187187
}
188188
189-
systemContext <software system identifier> <key> [description] {
189+
systemContext <software system identifier> [key] [description] {
190190
include <*|identifier> [identifier...]
191191
exclude <identifier> [identifier...]
192192
autoLayout [tb|bt|lr|rl] [rankSeparation] [nodeSeparation]
193193
animationStep <identifier> [identifier...]
194194
}
195195
196-
container <software system identifier> <key> [description] {
196+
container <software system identifier> [key] [description] {
197197
include <*|identifier> [identifier...]
198198
exclude <identifier> [identifier...]
199199
autoLayout [tb|bt|lr|rl] [rankSeparation] [nodeSeparation]
200200
animationStep <identifier> [identifier...]
201201
}
202202
203-
component <container identifier> <key> [description] {
203+
component <container identifier> [key] [description] {
204204
include <*|identifier> [identifier...]
205205
exclude <identifier> [identifier...]
206206
autoLayout [tb|bt|lr|rl] [rankSeparation] [nodeSeparation]
207207
animationStep <identifier> [identifier...]
208208
}
209209
210-
filtered <baseKey> <include|exclude> <tags> <key> [description]
210+
filtered <baseKey> <include|exclude> <tags> [key] [description]
211211
212-
dynamic <*|software system identifier|container identifier> <key> [description] {
212+
dynamic <*|software system identifier|container identifier> [key] [description] {
213213
<identifier> -> <identifier> [description]
214214
autoLayout [tb|bt|lr|rl] [rankSeparation] [nodeSeparation]
215215
}
216216
217-
deployment <*|software system identifier> <environment name> <key> [description] {
217+
deployment <*|software system identifier> <environment name> [key] [description] {
218218
include <*|identifier> [identifier...]
219219
exclude <identifier> [identifier...]
220220
autoLayout [tb|bt|lr|rl] [rankSeparation] [nodeSeparation]
@@ -434,7 +434,7 @@ The ```views``` block can contain the following:
434434
The ```systemLandscape``` keyword is used to define a [System Landscape view](https://c4model.com/#SystemLandscapeDiagram).
435435

436436
```
437-
systemLandscape <key> [description] {
437+
systemLandscape [key] [description] {
438438
...
439439
}
440440
```
@@ -451,7 +451,7 @@ The following keywords can be used within the ```systemLandscape``` block:
451451
The ```systemContext``` keyword is used to define a [System Context view](https://c4model.com/#SystemContextDiagram) for the specified software system.
452452

453453
```
454-
systemContext <software system identifier> <key> [description] {
454+
systemContext <software system identifier> [key] [description] {
455455
...
456456
}
457457
```
@@ -468,7 +468,7 @@ The following keywords can be used within the ```systemContext``` block:
468468
The ```container``` keyword is used to define a [Container view](https://c4model.com/#ContainerDiagram) for the specified software system.
469469

470470
```
471-
container <software system identifier> <key> [description] {
471+
container <software system identifier> [key] [description] {
472472
...
473473
}
474474
```
@@ -485,7 +485,7 @@ The following keywords can be used within the ```container``` block:
485485
The ```component``` keyword is used to define a [Component view](https://c4model.com/#ComponentDiagram) for the specified container.
486486

487487
```
488-
component <container identifier> <key> [description] {
488+
component <container identifier> [key] [description] {
489489
...
490490
}
491491
```
@@ -502,7 +502,7 @@ The following keywords can be used within the ```component``` block:
502502
The ```filtered``` keyword is used to define a [Filtered view](https://structurizr.com/help/filtered-views) on top of the specified view.
503503

504504
```
505-
filtered <baseKey> <include|exclude> <tags> <key> [description]
505+
filtered <baseKey> <include|exclude> <tags> [key] [description]
506506
```
507507

508508
The ```baseKey``` specifies the key of the System Landscape, System Context, Container, or Component view on which this filtered view should be based. The mode (```include``` or ```exclude```) defines whether the view should include or exclude elements/relationships based upon the ```tags``` provided.
@@ -512,7 +512,7 @@ The ```baseKey``` specifies the key of the System Landscape, System Context, Con
512512
The ```dynamic``` keyword defines a [Dynamic view](https://c4model.com/#DynamicDiagram) for the specified scope.
513513

514514
```
515-
dynamic <*|software system identifier|container identifier> <key> [description] {
515+
dynamic <*|software system identifier|container identifier> [key] [description] {
516516
...
517517
}
518518
```
@@ -540,7 +540,7 @@ The following keywords can also be used within the ```dynamic``` block:
540540
The ```deployment``` keyword defines a [Deployment view](https://c4model.com/#DeploymentDiagram) for the specified scope and deployment environment.
541541

542542
```
543-
deployment <*|software system identifier> <environment name> <key> [description] {
543+
deployment <*|software system identifier> <environment name> [key] [description] {
544544
...
545545
}
546546
```

examples/amazon-web-services.dsl

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ workspace "Amazon Web Services Example" "An example AWS deployment architecture.
77

88
webApplication -> database "Reads from and writes to", "JDBC/SSL"
99

10-
deploymentEnvironment {
10+
deploymentEnvironment "Live" {
1111
deploymentNode "Amazon Web Services" "" "" "Amazon Web Services - Cloud" {
1212
deploymentNode "US-East-1" "" "" "Amazon Web Services - Region" {
1313
route53 = infrastructureNode "Route 53" "" "" "Amazon Web Services - Route 53"
@@ -34,7 +34,7 @@ workspace "Amazon Web Services Example" "An example AWS deployment architecture.
3434
}
3535

3636
views {
37-
deployment springPetClinic "Default" "AmazonWebServicesDeployment" {
37+
deployment springPetClinic "Live" "AmazonWebServicesDeployment" {
3838
include *
3939
autolayout lr
4040
}

examples/logo.png

9.04 KB
Loading

examples/test.dsl

+104
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
workspace "Name" "Description" {
2+
3+
model {
4+
5+
user = person "User" "Description" "Tag"
6+
enterprise "Enterprise" {
7+
softwareSystem = softwareSystem "Software System" "Description" "Tag" {
8+
webApplication = container "Web Application" "Description" "Technology" "Tag" {
9+
homePageController = component "HomePageController" "Description" "Spring MVC Controller" "Tag"
10+
}
11+
}
12+
softwareSystem "E-mail System" "Description" "Tag"
13+
}
14+
15+
user -> HomePageController "Visits" "HTTPS" "Tag"
16+
17+
deploymentEnvironment "Live" {
18+
deploymentNode "Amazon Web Services" "Description" "Technology" "Tag" {
19+
infrastructureNode "Elastic Load Balancer" "Description" "Technology" "Tag"
20+
deploymentNode "Amazon Web Services - EC2" "Description" "Technology" "Tag" {
21+
containerInstance webApplication
22+
}
23+
}
24+
}
25+
}
26+
27+
views {
28+
29+
systemLandscape "SystemLandscape" "Description" {
30+
include *
31+
autoLayout
32+
}
33+
34+
systemContext softwareSystem "SystemContext" "Description" {
35+
include *
36+
autoLayout
37+
}
38+
39+
container softwareSystem "Containers" "Description" {
40+
include *
41+
autoLayout
42+
}
43+
44+
component webApplication "Components" "Description" {
45+
include *
46+
autoLayout
47+
}
48+
49+
dynamic webApplication "Dynamic" "Description" {
50+
user -> homePageController "Requests via web browser"
51+
autoLayout
52+
}
53+
54+
deployment * "Live" "Deployment-Live" "Description" {
55+
include *
56+
autoLayout
57+
}
58+
59+
styles {
60+
element "Element" {
61+
shape roundedbox
62+
icon logo.png
63+
width 450
64+
height 300
65+
background #ffffff
66+
color #000000
67+
colour #000000
68+
stroke #777777
69+
fontSize 24
70+
border solid
71+
opacity 50
72+
metadata false
73+
description false
74+
}
75+
76+
relationship "Relationship" {
77+
thickness 2
78+
color #777777
79+
colour #777777
80+
dashed true
81+
routing curved
82+
fontSize 24
83+
width 400
84+
position 50
85+
opacity 50
86+
}
87+
}
88+
89+
themes https://example.com/theme1 https://example.com/theme2 https://example.com/theme3
90+
91+
branding {
92+
logo logo.png
93+
font "Example" https://example/com/font
94+
}
95+
}
96+
97+
/**
98+
multi-line comment
99+
*/
100+
101+
# single line comment
102+
// single line comment
103+
104+
}

0 commit comments

Comments
 (0)