@@ -12,7 +12,7 @@ hidden terminal SL_COMMENT: /\/\/[^\n\r]*/;
1212
1313entry ContextMappingModel:
1414 (
15- (contextMaps +=ContextMap) |
15+ (contextMap +=ContextMap) |
1616 (boundedContexts+=BoundedContext) |
1717 (domains+=Domain) |
1818 (userRequirements+=UserRequirement) |
@@ -22,22 +22,20 @@ entry ContextMappingModel:
2222;
2323
2424/*
25- In Langium, elements in unordered groups are optional by default.
26- However, the usage of the ? cardinality is not allowed in unordered groups.
27- Therefore, to create a rule with optional, unordered elements, one needs to omit the ? operator and combine them with the & operator.
28- This behavior may change in the future.
29- Also, unordered groups may cause unreadable parsing errors. To resolve that, unordered groups can be replaced with a (A | B | C)* rule and enforce non-repetition of elements with a validator.
25+ Unordered groups may cause unreadable parsing errors. To resolve that, unordered groups can be replaced with a (A | B | C)* rule and enforce non-repetition of elements with a validator.
3026 https://github.com/eclipse-langium/langium/discussions/1903
27+ Also, unordered groups cause issues with autocomplete.
28+ Therefore all unordered group rules had to be converted to the recommended workaround from above.
3129 */
3230
3331ContextMap:
3432 // {ContextMap} make sure there is always a context map
3533 'ContextMap' (name=ID)?
3634 OPEN
3735 (
38- ('type' ('=')? type=ContextMapType) &
39- ('state' ('=')? state=ContextMapState)
40- )
36+ ('type' ('=')? type+ =ContextMapType) |
37+ ('state' ('=')? state+ =ContextMapState)
38+ )*
4139 ('contains' boundedContexts+=[BoundedContext] ("," boundedContexts+=[BoundedContext])*)*
4240 relationships+=Relationship*
4341 CLOSE
@@ -46,22 +44,22 @@ ContextMap:
4644BoundedContext:
4745 'BoundedContext' name=ID (
4846 (
49- ('implements' (implementedDomainParts+=[DomainPart]) ("," implementedDomainParts+=[DomainPart])*) &
50- ('realizes' (realizedBoundedContexts+=[BoundedContext]) ("," realizedBoundedContexts+=[BoundedContext])*) &
51- ('refines' refinedBoundedContext=[BoundedContext])
52- )
47+ ('implements' (implementedDomainParts+=[DomainPart]) ("," implementedDomainParts+=[DomainPart])*) |
48+ ('realizes' (realizedBoundedContexts+=[BoundedContext]) ("," realizedBoundedContexts+=[BoundedContext])*) |
49+ ('refines' refinedBoundedContext+ =[BoundedContext])
50+ )*
5351 )
5452 (
5553 OPEN
5654 (
57- ('domainVisionStatement' ('=')? domainVisionStatement=STRING) &
58- ('type' ('=')? type=BoundedContextType) &
59- (('responsibilities' ('=')? responsibilities+=STRING) ("," responsibilities+=STRING)*) &
60- ('implementationTechnology' ('=')? implementationTechnology=STRING) &
61- ('knowledgeLevel' ('=')? knowledgeLevel=KnowledgeLevel) &
62- ('businessModel' ('=')? businessModel=STRING) &
63- ('evolution' ('=')? evolution=Evolution)
64- )
55+ ('domainVisionStatement' ('=')? domainVisionStatement+ =STRING) |
56+ ('type' ('=')? type+ =BoundedContextType) |
57+ (('responsibilities' ('=')? responsibilities+=STRING) ("," responsibilities+=STRING)*) |
58+ ('implementationTechnology' ('=')? implementationTechnology+ =STRING) |
59+ ('knowledgeLevel' ('=')? knowledgeLevel+ =KnowledgeLevel) |
60+ ('businessModel' ('=')? businessModel+ =STRING) |
61+ ('evolution' ('=')? evolution+ =Evolution)
62+ )*
6563 (
6664 (
6765 modules+=SculptorModule |
@@ -91,9 +89,9 @@ Subdomain:
9189 (
9290 OPEN
9391 (
94- ('type' ('=')? type=SubDomainType) &
95- ('domainVisionStatement' ('=')? domainVisionStatement=STRING)
96- )
92+ ('type' ('=')? type+ =SubDomainType) |
93+ ('domainVisionStatement' ('=')? domainVisionStatement+ =STRING)
94+ )*
9795 CLOSE
9896 )?
9997;
@@ -147,10 +145,10 @@ UpstreamDownstreamRelationship:
147145 (':' name=ID)?
148146 (OPEN
149147 (
150- ('implementationTechnology' ('=')? implementationTechnology=STRING) &
151- (('exposedAggregates' ('=')? upstreamExposedAggregates+=[Aggregate]) ("," upstreamExposedAggregates+=[Aggregate])*) &
152- ('downstreamRights' ('=')? downstreamGovernanceRights=DownstreamGovernanceRights)
153- )
148+ ('implementationTechnology' ('=')? implementationTechnology+ =STRING) |
149+ (('exposedAggregates' ('=')? upstreamExposedAggregates+=[Aggregate]) ("," upstreamExposedAggregates+=[Aggregate])*) |
150+ ('downstreamRights' ('=')? downstreamGovernanceRights+ =DownstreamGovernanceRights)
151+ )*
154152 CLOSE)?
155153 )
156154;
@@ -166,10 +164,10 @@ CustomerSupplierRelationship:
166164 (':' name=ID)?
167165 (OPEN
168166 (
169- ('implementationTechnology' ('=')? implementationTechnology=STRING) &
170- (('exposedAggregates' ('=')? upstreamExposedAggregates+=[Aggregate]) ("," upstreamExposedAggregates+=[Aggregate])*) &
171- ('downstreamRights' ('=')? downstreamGovernanceRights=DownstreamGovernanceRights)
172- )
167+ ('implementationTechnology' ('=')? implementationTechnology+ =STRING) |
168+ (('exposedAggregates' ('=')? upstreamExposedAggregates+=[Aggregate]) ("," upstreamExposedAggregates+=[Aggregate])*) |
169+ ('downstreamRights' ('=')? downstreamGovernanceRights+ =DownstreamGovernanceRights)
170+ )*
173171 CLOSE)?
174172 )
175173;
@@ -178,23 +176,21 @@ Aggregate:
178176 (doc=STRING)?
179177 "Aggregate" name=ID (OPEN
180178 (
181- (('responsibilities' ('=')? responsibilities+=STRING) ("," responsibilities+=STRING)*) &
182- (
183- (('useCases' ('=')? useCases+=[UseCase]) ("," useCases+=[UseCase])*) |
184- (('userStories' ('=')? userStories+=[UserStory]) ("," userStories+=[UserStory])*) |
185- ((('features' | 'userRequirements') ('=')? userRequirements+=[UserRequirement]) ("," userRequirements+=[UserRequirement])*)
186- ) &
187- ('owner' ('=')? owner=[BoundedContext]) &
188- ('knowledgeLevel' ('=')? knowledgeLevel=KnowledgeLevel) &
189- (('likelihoodForChange' | 'structuralVolatility') ('=')? likelihoodForChange=Volatility) &
190- ('contentVolatility' ('=')? contentVolatility=Volatility) &
191- ('availabilityCriticality' ('=')? availabilityCriticality=Criticality) &
192- ('consistencyCriticality' ('=')? consistencyCriticality=Criticality) &
193- ('storageSimilarity' ('=')? storageSimilarity=Similarity) &
194- ('securityCriticality' ('=')? securityCriticality=Criticality) &
195- ('securityZone' ('=')? securityZone=STRING) &
196- ('securityAccessGroup' ('=')? securityAccessGroup=STRING)
197- )
179+ (('responsibilities' ('=')? responsibilities+=STRING) ("," responsibilities+=STRING)*) |
180+ (('useCases' ('=')? useCases+=[UseCase]) ("," useCases+=[UseCase])*) |
181+ (('userStories' ('=')? userStories+=[UserStory]) ("," userStories+=[UserStory])*) |
182+ ((('features' | 'userRequirements') ('=')? userRequirements+=[UserRequirement]) ("," userRequirements+=[UserRequirement])*) |
183+ ('owner' ('=')? owner+=[BoundedContext]) |
184+ ('knowledgeLevel' ('=')? knowledgeLevel+=KnowledgeLevel) |
185+ (('likelihoodForChange' | 'structuralVolatility') ('=')? likelihoodForChange+=Volatility) |
186+ ('contentVolatility' ('=')? contentVolatility+=Volatility) |
187+ ('availabilityCriticality' ('=')? availabilityCriticality+=Criticality) |
188+ ('consistencyCriticality' ('=')? consistencyCriticality+=Criticality) |
189+ ('storageSimilarity' ('=')? storageSimilarity+=Similarity) |
190+ ('securityCriticality' ('=')? securityCriticality+=Criticality) |
191+ ('securityZone' ('=')? securityZone+=STRING) |
192+ ('securityAccessGroup' ('=')? securityAccessGroup+=STRING)
193+ )*
198194 CLOSE)?
199195;
200196
@@ -205,13 +201,13 @@ UserRequirement:
205201UseCase:
206202 'UseCase' name=ID (OPEN
207203 (
208- ('actor' ('=')? role=STRING) &
209- ('secondaryActors' ('=')? secondaryActors+=STRING ("," secondaryActors+=STRING)*) &
210- ('interactions' ('=')? features+=Feature ("," features+=Feature)*) &
211- ('benefit' ('=')? benefit=STRING) &
212- ('scope' ('=')? scope=STRING) &
213- ('level' ('=')? level=STRING)
214- )
204+ ('actor' ('=')? role+ =STRING) |
205+ ('secondaryActors' ('=')? secondaryActors+=STRING ("," secondaryActors+=STRING)*) |
206+ ('interactions' ('=')? features+=Feature ("," features+=Feature)*) |
207+ ('benefit' ('=')? benefit+ =STRING) |
208+ ('scope' ('=')? scope+ =STRING) |
209+ ('level' ('=')? level+ =STRING)
210+ )*
215211 CLOSE)?
216212;
217213
@@ -247,10 +243,10 @@ SculptorModule:
247243 'Module' name=ID (
248244 OPEN
249245 (
250- (external? ='external') &
251- ('basePackage' '=' basePackage=JavaIdentifier) &
252- ('hint' '=' hint=STRING)
253- )
246+ (external+ ='external') |
247+ ('basePackage' '=' basePackage+ =JavaIdentifier) |
248+ ('hint' '=' hint+ =STRING)
249+ )*
254250 (
255251 (aggregates+=Aggregate)
256252 )*
@@ -286,10 +282,10 @@ StakeholderGroup:
286282Stakeholder:
287283 'Stakeholder' name=ID (OPEN
288284 (
289- ('influence' ('=')? influence=INFLUENCE) &
290- ('interest' ('=')? interest=INTEREST) &
291- ('description' ('=')? description=STRING)
292- )
285+ ('influence' ('=')? influence+ =INFLUENCE) |
286+ ('interest' ('=')? interest+ =INTEREST) |
287+ ('description' ('=')? description+ =STRING)
288+ )*
293289 CLOSE)?
294290;
295291
@@ -334,10 +330,10 @@ Value:
334330ValueElicitation:
335331 ('Stakeholder'|'Stakeholders') stakeholder=[AbstractStakeholder] (OPEN
336332 (
337- ('priority' ('=')? priority=PRIORITY) &
338- ('impact' ('=')? impact=IMPACT) &
333+ ('priority' ('=')? priority+ =PRIORITY) |
334+ ('impact' ('=')? impact+ =IMPACT) |
339335 ('consequences' (consequences+=Consequence)+)
340- )
336+ )*
341337 CLOSE)?
342338;
343339
@@ -347,9 +343,9 @@ ValueEpic:
347343 (
348344 'As a' stakeholder=[AbstractStakeholder] 'I value' value=STRING 'as demonstrated in'
349345 (
350- ('realization of' realizedValues+=STRING)+ &
346+ ('realization of' realizedValues+=STRING)+ |
351347 ('reduction of' reducedValues+=STRING)+
352- )
348+ )*
353349 )
354350 CLOSE)?
355351;
0 commit comments