diff options
author | Kristóf Marussy <kristof@marussy.com> | 2024-02-11 01:13:13 +0100 |
---|---|---|
committer | Kristóf Marussy <kristof@marussy.com> | 2024-02-11 19:55:41 +0100 |
commit | b64100256d399128fc2373195351d259bd2ab1fb (patch) | |
tree | 06341db872c75acaedaf6028c83223669ba12058 /subprojects | |
parent | feat(language): automatic problem kind inference (diff) | |
download | refinery-b64100256d399128fc2373195351d259bd2ab1fb.tar.gz refinery-b64100256d399128fc2373195351d259bd2ab1fb.tar.zst refinery-b64100256d399128fc2373195351d259bd2ab1fb.zip |
refactor(language): simplify default module kinds
Use a transient attribute instead of an adapter.
Diffstat (limited to 'subprojects')
6 files changed, 32 insertions, 39 deletions
diff --git a/subprojects/language-model/problem.aird b/subprojects/language-model/problem.aird index ed3a4b58..cbe413cd 100644 --- a/subprojects/language-model/problem.aird +++ b/subprojects/language-model/problem.aird | |||
@@ -7,7 +7,7 @@ | |||
7 | <semanticResources>build/resources/main/model/problem.genmodel</semanticResources> | 7 | <semanticResources>build/resources/main/model/problem.genmodel</semanticResources> |
8 | <ownedViews xmi:type="viewpoint:DView" uid="_CsAAYKA4EeuqkpDnuik1sg"> | 8 | <ownedViews xmi:type="viewpoint:DView" uid="_CsAAYKA4EeuqkpDnuik1sg"> |
9 | <viewpoint xmi:type="description:Viewpoint" href="platform:/plugin/org.eclipse.emf.ecoretools.design/description/ecore.odesign#//@ownedViewpoints[name='Design']"/> | 9 | <viewpoint xmi:type="description:Viewpoint" href="platform:/plugin/org.eclipse.emf.ecoretools.design/description/ecore.odesign#//@ownedViewpoints[name='Design']"/> |
10 | <ownedRepresentationDescriptors xmi:type="viewpoint:DRepresentationDescriptor" uid="_CsYa4KA4EeuqkpDnuik1sg" name="declarations" repPath="#_CsUwgKA4EeuqkpDnuik1sg" changeId="1707054359028"> | 10 | <ownedRepresentationDescriptors xmi:type="viewpoint:DRepresentationDescriptor" uid="_CsYa4KA4EeuqkpDnuik1sg" name="declarations" repPath="#_CsUwgKA4EeuqkpDnuik1sg" changeId="1707609830791"> |
11 | <description xmi:type="description_1:DiagramDescription" href="platform:/plugin/org.eclipse.emf.ecoretools.design/description/ecore.odesign#//@ownedViewpoints[name='Design']/@ownedRepresentations[name='Entities']"/> | 11 | <description xmi:type="description_1:DiagramDescription" href="platform:/plugin/org.eclipse.emf.ecoretools.design/description/ecore.odesign#//@ownedViewpoints[name='Design']/@ownedRepresentations[name='Entities']"/> |
12 | <target xmi:type="ecore:EPackage" href="src/main/resources/model/problem.ecore#/"/> | 12 | <target xmi:type="ecore:EPackage" href="src/main/resources/model/problem.ecore#/"/> |
13 | </ownedRepresentationDescriptors> | 13 | </ownedRepresentationDescriptors> |
@@ -35,11 +35,15 @@ | |||
35 | <styles xmi:type="notation:FontStyle" xmi:id="_ep380b_JEe6Mo_-4--GvQg" fontColor="2697711" fontName="Noto Sans" fontHeight="8"/> | 35 | <styles xmi:type="notation:FontStyle" xmi:id="_ep380b_JEe6Mo_-4--GvQg" fontColor="2697711" fontName="Noto Sans" fontHeight="8"/> |
36 | <layoutConstraint xmi:type="notation:Location" xmi:id="_ep380r_JEe6Mo_-4--GvQg"/> | 36 | <layoutConstraint xmi:type="notation:Location" xmi:id="_ep380r_JEe6Mo_-4--GvQg"/> |
37 | </children> | 37 | </children> |
38 | <children xmi:type="notation:Node" xmi:id="__XFXYMhwEe6Iq6PhcjImzA" type="3010" element="__V2BQMhwEe6Iq6PhcjImzA"> | ||
39 | <styles xmi:type="notation:FontStyle" xmi:id="__XFXYchwEe6Iq6PhcjImzA" fontColor="2697711" fontName="Noto Sans" fontHeight="8"/> | ||
40 | <layoutConstraint xmi:type="notation:Location" xmi:id="__XFXYshwEe6Iq6PhcjImzA"/> | ||
41 | </children> | ||
38 | <styles xmi:type="notation:SortingStyle" xmi:id="_D1FIUaA4EeuqkpDnuik1sg"/> | 42 | <styles xmi:type="notation:SortingStyle" xmi:id="_D1FIUaA4EeuqkpDnuik1sg"/> |
39 | <styles xmi:type="notation:FilteringStyle" xmi:id="_D1FIUqA4EeuqkpDnuik1sg"/> | 43 | <styles xmi:type="notation:FilteringStyle" xmi:id="_D1FIUqA4EeuqkpDnuik1sg"/> |
40 | </children> | 44 | </children> |
41 | <styles xmi:type="notation:ShapeStyle" xmi:id="_D1D6MaA4EeuqkpDnuik1sg" fontName="Noto Sans" fontHeight="8"/> | 45 | <styles xmi:type="notation:ShapeStyle" xmi:id="_D1D6MaA4EeuqkpDnuik1sg" fontName="Noto Sans" fontHeight="8"/> |
42 | <layoutConstraint xmi:type="notation:Bounds" xmi:id="_D1D6MqA4EeuqkpDnuik1sg" x="776" y="176" width="120" height="100"/> | 46 | <layoutConstraint xmi:type="notation:Bounds" xmi:id="_D1D6MqA4EeuqkpDnuik1sg" x="761" y="176" width="154" height="100"/> |
43 | </children> | 47 | </children> |
44 | <children xmi:type="notation:Node" xmi:id="_JT0o8KA4EeuqkpDnuik1sg" type="2003" element="_JTstIKA4EeuqkpDnuik1sg"> | 48 | <children xmi:type="notation:Node" xmi:id="_JT0o8KA4EeuqkpDnuik1sg" type="2003" element="_JTstIKA4EeuqkpDnuik1sg"> |
45 | <children xmi:type="notation:Node" xmi:id="_JT1QAKA4EeuqkpDnuik1sg" type="5007"/> | 49 | <children xmi:type="notation:Node" xmi:id="_JT1QAKA4EeuqkpDnuik1sg" type="5007"/> |
@@ -505,7 +509,7 @@ | |||
505 | <styles xmi:type="notation:ConnectorStyle" xmi:id="_4ea_0KA8EeuqkpDnuik1sg" routing="Rectilinear"/> | 509 | <styles xmi:type="notation:ConnectorStyle" xmi:id="_4ea_0KA8EeuqkpDnuik1sg" routing="Rectilinear"/> |
506 | <styles xmi:type="notation:FontStyle" xmi:id="_4ea_0aA8EeuqkpDnuik1sg" fontColor="7490599" fontName="Noto Sans" fontHeight="8"/> | 510 | <styles xmi:type="notation:FontStyle" xmi:id="_4ea_0aA8EeuqkpDnuik1sg" fontColor="7490599" fontName="Noto Sans" fontHeight="8"/> |
507 | <bendpoints xmi:type="notation:RelativeBendpoints" xmi:id="_4ea_0qA8EeuqkpDnuik1sg" points="[-21, 50, -159, -58]$[-34, 84, -172, -24]$[137, 84, -1, -24]$[137, 107, -1, -1]"/> | 511 | <bendpoints xmi:type="notation:RelativeBendpoints" xmi:id="_4ea_0qA8EeuqkpDnuik1sg" points="[-21, 50, -159, -58]$[-34, 84, -172, -24]$[137, 84, -1, -24]$[137, 107, -1, -1]"/> |
508 | <sourceAnchor xmi:type="notation:IdentityAnchor" xmi:id="_4ea_2aA8EeuqkpDnuik1sg" id="(1.0,0.4897959183673469)"/> | 512 | <sourceAnchor xmi:type="notation:IdentityAnchor" xmi:id="_4ea_2aA8EeuqkpDnuik1sg" id="(0.875,0.4897959183673469)"/> |
509 | <targetAnchor xmi:type="notation:IdentityAnchor" xmi:id="_4ea_2qA8EeuqkpDnuik1sg" id="(0.3389830508474576,0.0)"/> | 513 | <targetAnchor xmi:type="notation:IdentityAnchor" xmi:id="_4ea_2qA8EeuqkpDnuik1sg" id="(0.3389830508474576,0.0)"/> |
510 | </edges> | 514 | </edges> |
511 | <edges xmi:type="notation:Edge" xmi:id="_hU_wsKA9EeuqkpDnuik1sg" type="4001" element="_hU64ZqA9EeuqkpDnuik1sg" source="_D1D6MKA4EeuqkpDnuik1sg" target="_e73WIKA9EeuqkpDnuik1sg"> | 515 | <edges xmi:type="notation:Edge" xmi:id="_hU_wsKA9EeuqkpDnuik1sg" type="4001" element="_hU64ZqA9EeuqkpDnuik1sg" source="_D1D6MKA4EeuqkpDnuik1sg" target="_e73WIKA9EeuqkpDnuik1sg"> |
@@ -521,7 +525,7 @@ | |||
521 | <styles xmi:type="notation:ConnectorStyle" xmi:id="_hU_wsaA9EeuqkpDnuik1sg" routing="Rectilinear"/> | 525 | <styles xmi:type="notation:ConnectorStyle" xmi:id="_hU_wsaA9EeuqkpDnuik1sg" routing="Rectilinear"/> |
522 | <styles xmi:type="notation:FontStyle" xmi:id="_hU_wsqA9EeuqkpDnuik1sg" fontColor="7490599" fontName="Noto Sans" fontHeight="8"/> | 526 | <styles xmi:type="notation:FontStyle" xmi:id="_hU_wsqA9EeuqkpDnuik1sg" fontColor="7490599" fontName="Noto Sans" fontHeight="8"/> |
523 | <bendpoints xmi:type="notation:RelativeBendpoints" xmi:id="_hU_ws6A9EeuqkpDnuik1sg" points="[0, 0, 0, -58]$[0, 58, 0, 0]"/> | 527 | <bendpoints xmi:type="notation:RelativeBendpoints" xmi:id="_hU_ws6A9EeuqkpDnuik1sg" points="[0, 0, 0, -58]$[0, 58, 0, 0]"/> |
524 | <sourceAnchor xmi:type="notation:IdentityAnchor" xmi:id="_hU_wuqA9EeuqkpDnuik1sg" id="(0.5,1.0)"/> | 528 | <sourceAnchor xmi:type="notation:IdentityAnchor" xmi:id="_hU_wuqA9EeuqkpDnuik1sg" id="(0.4868421052631579,1.0)"/> |
525 | <targetAnchor xmi:type="notation:IdentityAnchor" xmi:id="_hU_wu6A9EeuqkpDnuik1sg" id="(0.5,0.0)"/> | 529 | <targetAnchor xmi:type="notation:IdentityAnchor" xmi:id="_hU_wu6A9EeuqkpDnuik1sg" id="(0.5,0.0)"/> |
526 | </edges> | 530 | </edges> |
527 | <edges xmi:type="notation:Edge" xmi:id="_m_tfgNXtEeuF_d0WEhR3Xw" type="4001" element="_m-6OTNXtEeuF_d0WEhR3Xw" source="_D1D6MKA4EeuqkpDnuik1sg" target="_RzZA0KA5EeuqkpDnuik1sg"> | 531 | <edges xmi:type="notation:Edge" xmi:id="_m_tfgNXtEeuF_d0WEhR3Xw" type="4001" element="_m-6OTNXtEeuF_d0WEhR3Xw" source="_D1D6MKA4EeuqkpDnuik1sg" target="_RzZA0KA5EeuqkpDnuik1sg"> |
@@ -537,7 +541,7 @@ | |||
537 | <styles xmi:type="notation:ConnectorStyle" xmi:id="_m_tfgdXtEeuF_d0WEhR3Xw" routing="Tree"/> | 541 | <styles xmi:type="notation:ConnectorStyle" xmi:id="_m_tfgdXtEeuF_d0WEhR3Xw" routing="Tree"/> |
538 | <styles xmi:type="notation:FontStyle" xmi:id="_m_tfgtXtEeuF_d0WEhR3Xw" fontName="Noto Sans" fontHeight="8"/> | 542 | <styles xmi:type="notation:FontStyle" xmi:id="_m_tfgtXtEeuF_d0WEhR3Xw" fontName="Noto Sans" fontHeight="8"/> |
539 | <bendpoints xmi:type="notation:RelativeBendpoints" xmi:id="_m_tfg9XtEeuF_d0WEhR3Xw" points="[0, 0, 205, 107]$[0, -24, 205, 83]$[-204, -24, 1, 83]$[-204, -58, 1, 49]"/> | 543 | <bendpoints xmi:type="notation:RelativeBendpoints" xmi:id="_m_tfg9XtEeuF_d0WEhR3Xw" points="[0, 0, 205, 107]$[0, -24, 205, 83]$[-204, -24, 1, 83]$[-204, -58, 1, 49]"/> |
540 | <sourceAnchor xmi:type="notation:IdentityAnchor" xmi:id="_m_00QNXtEeuF_d0WEhR3Xw" id="(0.711864406779661,0.0)"/> | 544 | <sourceAnchor xmi:type="notation:IdentityAnchor" xmi:id="_m_00QNXtEeuF_d0WEhR3Xw" id="(0.6513157894736842,0.0)"/> |
541 | <targetAnchor xmi:type="notation:IdentityAnchor" xmi:id="_m_00QdXtEeuF_d0WEhR3Xw" id="(0.5,0.5)"/> | 545 | <targetAnchor xmi:type="notation:IdentityAnchor" xmi:id="_m_00QdXtEeuF_d0WEhR3Xw" id="(0.5,0.5)"/> |
542 | </edges> | 546 | </edges> |
543 | <edges xmi:type="notation:Edge" xmi:id="_pldLAKA9EeuqkpDnuik1sg" type="4001" element="_plK3JqA9EeuqkpDnuik1sg" source="_JT0o8KA4EeuqkpDnuik1sg" target="_e73WIKA9EeuqkpDnuik1sg"> | 547 | <edges xmi:type="notation:Edge" xmi:id="_pldLAKA9EeuqkpDnuik1sg" type="4001" element="_plK3JqA9EeuqkpDnuik1sg" source="_JT0o8KA4EeuqkpDnuik1sg" target="_e73WIKA9EeuqkpDnuik1sg"> |
@@ -1400,7 +1404,7 @@ | |||
1400 | <styles xmi:type="notation:FontStyle" xmi:id="_bYblgsBeEe6Mo_-4--GvQg" fontColor="7490599" fontName="Noto Sans" fontHeight="8"/> | 1404 | <styles xmi:type="notation:FontStyle" xmi:id="_bYblgsBeEe6Mo_-4--GvQg" fontColor="7490599" fontName="Noto Sans" fontHeight="8"/> |
1401 | <bendpoints xmi:type="notation:RelativeBendpoints" xmi:id="_bYblg8BeEe6Mo_-4--GvQg" points="[0, 0, -778, 292]$[0, -293, -778, -1]$[776, -293, -2, -1]"/> | 1405 | <bendpoints xmi:type="notation:RelativeBendpoints" xmi:id="_bYblg8BeEe6Mo_-4--GvQg" points="[0, 0, -778, 292]$[0, -293, -778, -1]$[776, -293, -2, -1]"/> |
1402 | <sourceAnchor xmi:type="notation:IdentityAnchor" xmi:id="_bYblisBeEe6Mo_-4--GvQg" id="(0.4067796610169492,0.0)"/> | 1406 | <sourceAnchor xmi:type="notation:IdentityAnchor" xmi:id="_bYblisBeEe6Mo_-4--GvQg" id="(0.4067796610169492,0.0)"/> |
1403 | <targetAnchor xmi:type="notation:IdentityAnchor" xmi:id="_bYbli8BeEe6Mo_-4--GvQg" id="(0.01694915254237288,0.5714285714285714)"/> | 1407 | <targetAnchor xmi:type="notation:IdentityAnchor" xmi:id="_bYbli8BeEe6Mo_-4--GvQg" id="(0.1118421052631579,0.5714285714285714)"/> |
1404 | </edges> | 1408 | </edges> |
1405 | </data> | 1409 | </data> |
1406 | </ownedAnnotationEntries> | 1410 | </ownedAnnotationEntries> |
@@ -1423,7 +1427,7 @@ | |||
1423 | <arrangeConstraints>KEEP_LOCATION</arrangeConstraints> | 1427 | <arrangeConstraints>KEEP_LOCATION</arrangeConstraints> |
1424 | <arrangeConstraints>KEEP_SIZE</arrangeConstraints> | 1428 | <arrangeConstraints>KEEP_SIZE</arrangeConstraints> |
1425 | <arrangeConstraints>KEEP_RATIO</arrangeConstraints> | 1429 | <arrangeConstraints>KEEP_RATIO</arrangeConstraints> |
1426 | <ownedStyle xmi:type="diagram:FlatContainerStyle" uid="_fPhnkb_JEe6Mo_-4--GvQg" borderSize="1" borderSizeComputationExpression="1" backgroundStyle="Liquid" foregroundColor="255,252,216"> | 1430 | <ownedStyle xmi:type="diagram:FlatContainerStyle" uid="_BGp3kchxEe6Iq6PhcjImzA" borderSize="1" borderSizeComputationExpression="1" backgroundStyle="Liquid" foregroundColor="255,252,216"> |
1427 | <description xmi:type="style:FlatContainerStyleDescription" href="platform:/plugin/org.eclipse.emf.ecoretools.design/description/ecore.odesign#//@ownedViewpoints[name='Design']/@ownedRepresentations[name='Entities']/@defaultLayer/@containerMappings[name='EC%20EClass']/@style"/> | 1431 | <description xmi:type="style:FlatContainerStyleDescription" href="platform:/plugin/org.eclipse.emf.ecoretools.design/description/ecore.odesign#//@ownedViewpoints[name='Design']/@ownedRepresentations[name='Entities']/@defaultLayer/@containerMappings[name='EC%20EClass']/@style"/> |
1428 | </ownedStyle> | 1432 | </ownedStyle> |
1429 | <actualMapping xmi:type="description_1:ContainerMapping" href="platform:/plugin/org.eclipse.emf.ecoretools.design/description/ecore.odesign#//@ownedViewpoints[name='Design']/@ownedRepresentations[name='Entities']/@defaultLayer/@containerMappings[name='EC%20EClass']"/> | 1433 | <actualMapping xmi:type="description_1:ContainerMapping" href="platform:/plugin/org.eclipse.emf.ecoretools.design/description/ecore.odesign#//@ownedViewpoints[name='Design']/@ownedRepresentations[name='Entities']/@defaultLayer/@containerMappings[name='EC%20EClass']"/> |
@@ -1435,6 +1439,14 @@ | |||
1435 | </ownedStyle> | 1439 | </ownedStyle> |
1436 | <actualMapping xmi:type="description_1:NodeMapping" href="platform:/plugin/org.eclipse.emf.ecoretools.design/description/ecore.odesign#//@ownedViewpoints[name='Design']/@ownedRepresentations[name='Entities']/@defaultLayer/@containerMappings[name='EC%20EClass']/@subNodeMappings[name='EC%20EAttribute']"/> | 1440 | <actualMapping xmi:type="description_1:NodeMapping" href="platform:/plugin/org.eclipse.emf.ecoretools.design/description/ecore.odesign#//@ownedViewpoints[name='Design']/@ownedRepresentations[name='Entities']/@defaultLayer/@containerMappings[name='EC%20EClass']/@subNodeMappings[name='EC%20EAttribute']"/> |
1437 | </ownedElements> | 1441 | </ownedElements> |
1442 | <ownedElements xmi:type="diagram:DNodeListElement" uid="__V2BQMhwEe6Iq6PhcjImzA" name="explicitKind : EBoolean = false" tooltipText=""> | ||
1443 | <target xmi:type="ecore:EAttribute" href="src/main/resources/model/problem.ecore#//Problem/explicitKind"/> | ||
1444 | <semanticElements xmi:type="ecore:EAttribute" href="src/main/resources/model/problem.ecore#//Problem/explicitKind"/> | ||
1445 | <ownedStyle xmi:type="diagram:BundledImage" uid="_BGuwEshxEe6Iq6PhcjImzA" labelAlignment="LEFT"> | ||
1446 | <description xmi:type="style:BundledImageDescription" href="platform:/plugin/org.eclipse.emf.ecoretools.design/description/ecore.odesign#//@ownedViewpoints[name='Design']/@ownedRepresentations[name='Entities']/@defaultLayer/@containerMappings[name='EC%20EClass']/@subNodeMappings[name='EC%20EAttribute']/@style"/> | ||
1447 | </ownedStyle> | ||
1448 | <actualMapping xmi:type="description_1:NodeMapping" href="platform:/plugin/org.eclipse.emf.ecoretools.design/description/ecore.odesign#//@ownedViewpoints[name='Design']/@ownedRepresentations[name='Entities']/@defaultLayer/@containerMappings[name='EC%20EClass']/@subNodeMappings[name='EC%20EAttribute']"/> | ||
1449 | </ownedElements> | ||
1438 | </ownedDiagramElements> | 1450 | </ownedDiagramElements> |
1439 | <ownedDiagramElements xmi:type="diagram:DNodeList" uid="_JTstIKA4EeuqkpDnuik1sg" name="ClassDeclaration" tooltipText="" outgoingEdges="_jk6-PKA4EeuqkpDnuik1sg _plK3JqA9EeuqkpDnuik1sg _-XLKltawEeuymriYTNxK2g _m2GbcmTvEe2qdtyPWAtoxA _YWqZhmTzEe2qdtyPWAtoxA" width="12" height="10"> | 1451 | <ownedDiagramElements xmi:type="diagram:DNodeList" uid="_JTstIKA4EeuqkpDnuik1sg" name="ClassDeclaration" tooltipText="" outgoingEdges="_jk6-PKA4EeuqkpDnuik1sg _plK3JqA9EeuqkpDnuik1sg _-XLKltawEeuymriYTNxK2g _m2GbcmTvEe2qdtyPWAtoxA _YWqZhmTzEe2qdtyPWAtoxA" width="12" height="10"> |
1440 | <target xmi:type="ecore:EClass" href="src/main/resources/model/problem.ecore#//ClassDeclaration"/> | 1452 | <target xmi:type="ecore:EClass" href="src/main/resources/model/problem.ecore#//ClassDeclaration"/> |
@@ -1827,12 +1839,12 @@ | |||
1827 | <ownedDiagramElements xmi:type="diagram:DEdge" uid="_m-6OTNXtEeuF_d0WEhR3Xw" sourceNode="_D05iIKA4EeuqkpDnuik1sg" targetNode="_RzK-YKA5EeuqkpDnuik1sg"> | 1839 | <ownedDiagramElements xmi:type="diagram:DEdge" uid="_m-6OTNXtEeuF_d0WEhR3Xw" sourceNode="_D05iIKA4EeuqkpDnuik1sg" targetNode="_RzK-YKA5EeuqkpDnuik1sg"> |
1828 | <target xmi:type="ecore:EClass" href="src/main/resources/model/problem.ecore#//Problem"/> | 1840 | <target xmi:type="ecore:EClass" href="src/main/resources/model/problem.ecore#//Problem"/> |
1829 | <semanticElements xmi:type="ecore:EClass" href="src/main/resources/model/problem.ecore#//Problem"/> | 1841 | <semanticElements xmi:type="ecore:EClass" href="src/main/resources/model/problem.ecore#//Problem"/> |
1830 | <ownedStyle xmi:type="diagram:EdgeStyle" uid="_fPrYkL_JEe6Mo_-4--GvQg" targetArrow="InputClosedArrow" routingStyle="tree"> | 1842 | <ownedStyle xmi:type="diagram:EdgeStyle" uid="_BHDgMMhxEe6Iq6PhcjImzA" targetArrow="InputClosedArrow" routingStyle="tree"> |
1831 | <description xmi:type="style:EdgeStyleDescription" href="platform:/plugin/org.eclipse.emf.ecoretools.design/description/ecore.odesign#//@ownedViewpoints[name='Design']/@ownedRepresentations[name='Entities']/@defaultLayer/@edgeMappings[name='EC%20ESupertypes']/@style"/> | 1843 | <description xmi:type="style:EdgeStyleDescription" href="platform:/plugin/org.eclipse.emf.ecoretools.design/description/ecore.odesign#//@ownedViewpoints[name='Design']/@ownedRepresentations[name='Entities']/@defaultLayer/@edgeMappings[name='EC%20ESupertypes']/@style"/> |
1832 | <beginLabelStyle xmi:type="diagram:BeginLabelStyle" uid="_fPrYkb_JEe6Mo_-4--GvQg" showIcon="false"> | 1844 | <beginLabelStyle xmi:type="diagram:BeginLabelStyle" uid="_BHDgMchxEe6Iq6PhcjImzA" showIcon="false"> |
1833 | <labelFormat>italic</labelFormat> | 1845 | <labelFormat>italic</labelFormat> |
1834 | </beginLabelStyle> | 1846 | </beginLabelStyle> |
1835 | <centerLabelStyle xmi:type="diagram:CenterLabelStyle" uid="_fPrYkr_JEe6Mo_-4--GvQg" showIcon="false"/> | 1847 | <centerLabelStyle xmi:type="diagram:CenterLabelStyle" uid="_BHDgMshxEe6Iq6PhcjImzA" showIcon="false"/> |
1836 | </ownedStyle> | 1848 | </ownedStyle> |
1837 | <actualMapping xmi:type="description_1:EdgeMapping" href="platform:/plugin/org.eclipse.emf.ecoretools.design/description/ecore.odesign#//@ownedViewpoints[name='Design']/@ownedRepresentations[name='Entities']/@defaultLayer/@edgeMappings[name='EC%20ESupertypes']"/> | 1849 | <actualMapping xmi:type="description_1:EdgeMapping" href="platform:/plugin/org.eclipse.emf.ecoretools.design/description/ecore.odesign#//@ownedViewpoints[name='Design']/@ownedRepresentations[name='Entities']/@defaultLayer/@edgeMappings[name='EC%20ESupertypes']"/> |
1838 | </ownedDiagramElements> | 1850 | </ownedDiagramElements> |
diff --git a/subprojects/language-model/src/main/resources/model/problem.ecore b/subprojects/language-model/src/main/resources/model/problem.ecore index f7c85290..97355516 100644 --- a/subprojects/language-model/src/main/resources/model/problem.ecore +++ b/subprojects/language-model/src/main/resources/model/problem.ecore | |||
@@ -7,6 +7,8 @@ | |||
7 | <eStructuralFeatures xsi:type="ecore:EReference" name="statements" upperBound="-1" | 7 | <eStructuralFeatures xsi:type="ecore:EReference" name="statements" upperBound="-1" |
8 | eType="#//Statement" containment="true"/> | 8 | eType="#//Statement" containment="true"/> |
9 | <eStructuralFeatures xsi:type="ecore:EAttribute" name="kind" eType="#//ModuleKind"/> | 9 | <eStructuralFeatures xsi:type="ecore:EAttribute" name="kind" eType="#//ModuleKind"/> |
10 | <eStructuralFeatures xsi:type="ecore:EAttribute" name="explicitKind" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBoolean" | ||
11 | transient="true"/> | ||
10 | </eClassifiers> | 12 | </eClassifiers> |
11 | <eClassifiers xsi:type="ecore:EClass" name="ClassDeclaration" eSuperTypes="#//Statement #//Relation"> | 13 | <eClassifiers xsi:type="ecore:EClass" name="ClassDeclaration" eSuperTypes="#//Statement #//Relation"> |
12 | <eStructuralFeatures xsi:type="ecore:EAttribute" name="abstract" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBoolean"/> | 14 | <eStructuralFeatures xsi:type="ecore:EAttribute" name="abstract" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBoolean"/> |
diff --git a/subprojects/language-model/src/main/resources/model/problem.genmodel b/subprojects/language-model/src/main/resources/model/problem.genmodel index 85cd802b..23458ee5 100644 --- a/subprojects/language-model/src/main/resources/model/problem.genmodel +++ b/subprojects/language-model/src/main/resources/model/problem.genmodel | |||
@@ -77,6 +77,7 @@ | |||
77 | <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference problem.ecore#//Problem/nodes"/> | 77 | <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference problem.ecore#//Problem/nodes"/> |
78 | <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference problem.ecore#//Problem/statements"/> | 78 | <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference problem.ecore#//Problem/statements"/> |
79 | <genFeatures createChild="false" ecoreFeature="ecore:EAttribute problem.ecore#//Problem/kind"/> | 79 | <genFeatures createChild="false" ecoreFeature="ecore:EAttribute problem.ecore#//Problem/kind"/> |
80 | <genFeatures createChild="false" ecoreFeature="ecore:EAttribute problem.ecore#//Problem/explicitKind"/> | ||
80 | </genClasses> | 81 | </genClasses> |
81 | <genClasses ecoreClass="problem.ecore#//ClassDeclaration"> | 82 | <genClasses ecoreClass="problem.ecore#//ClassDeclaration"> |
82 | <genFeatures createChild="false" ecoreFeature="ecore:EAttribute problem.ecore#//ClassDeclaration/abstract"/> | 83 | <genFeatures createChild="false" ecoreFeature="ecore:EAttribute problem.ecore#//ClassDeclaration/abstract"/> |
diff --git a/subprojects/language/src/main/java/tools/refinery/language/parser/ProblemEcoreElementFactory.java b/subprojects/language/src/main/java/tools/refinery/language/parser/ProblemEcoreElementFactory.java index b54c6970..7d246117 100644 --- a/subprojects/language/src/main/java/tools/refinery/language/parser/ProblemEcoreElementFactory.java +++ b/subprojects/language/src/main/java/tools/refinery/language/parser/ProblemEcoreElementFactory.java | |||
@@ -5,9 +5,7 @@ | |||
5 | */ | 5 | */ |
6 | package tools.refinery.language.parser; | 6 | package tools.refinery.language.parser; |
7 | 7 | ||
8 | import org.eclipse.emf.common.notify.impl.AdapterImpl; | ||
9 | import org.eclipse.emf.ecore.EObject; | 8 | import org.eclipse.emf.ecore.EObject; |
10 | import org.eclipse.emf.ecore.util.EcoreUtil; | ||
11 | import org.eclipse.xtext.conversion.ValueConverterException; | 9 | import org.eclipse.xtext.conversion.ValueConverterException; |
12 | import org.eclipse.xtext.nodemodel.INode; | 10 | import org.eclipse.xtext.nodemodel.INode; |
13 | import org.eclipse.xtext.parser.DefaultEcoreElementFactory; | 11 | import org.eclipse.xtext.parser.DefaultEcoreElementFactory; |
@@ -20,29 +18,7 @@ public class ProblemEcoreElementFactory extends DefaultEcoreElementFactory { | |||
20 | EObject object, String feature, Object value, String ruleName, INode node) throws ValueConverterException { | 18 | EObject object, String feature, Object value, String ruleName, INode node) throws ValueConverterException { |
21 | super.set(object, feature, value, ruleName, node); | 19 | super.set(object, feature, value, ruleName, node); |
22 | if (object instanceof Problem problem && ProblemPackage.Literals.PROBLEM__KIND.getName().equals(feature)) { | 20 | if (object instanceof Problem problem && ProblemPackage.Literals.PROBLEM__KIND.getName().equals(feature)) { |
23 | ExplicitAssignmentTracker.install(problem); | 21 | problem.setExplicitKind(true); |
24 | } | ||
25 | } | ||
26 | |||
27 | public static boolean hasExplicitlySetProblemKind(Problem problem) { | ||
28 | return ExplicitAssignmentTracker.hasAdapter(problem); | ||
29 | } | ||
30 | |||
31 | private static class ExplicitAssignmentTracker extends AdapterImpl { | ||
32 | @Override | ||
33 | public boolean isAdapterForType(Object type) { | ||
34 | return type == ExplicitAssignmentTracker.class; | ||
35 | } | ||
36 | |||
37 | public static boolean hasAdapter(Problem problem) { | ||
38 | return EcoreUtil.getAdapter(problem.eAdapters(), ExplicitAssignmentTracker.class) != null; | ||
39 | } | ||
40 | |||
41 | public static void install(Problem problem) { | ||
42 | if (hasAdapter(problem)) { | ||
43 | throw new IllegalStateException("Duplicate explicit assignment of module kind"); | ||
44 | } | ||
45 | problem.eAdapters().add(new ExplicitAssignmentTracker()); | ||
46 | } | 22 | } |
47 | } | 23 | } |
48 | } | 24 | } |
diff --git a/subprojects/language/src/main/java/tools/refinery/language/resource/ProblemResource.java b/subprojects/language/src/main/java/tools/refinery/language/resource/ProblemResource.java index 57b7bb45..440a238e 100644 --- a/subprojects/language/src/main/java/tools/refinery/language/resource/ProblemResource.java +++ b/subprojects/language/src/main/java/tools/refinery/language/resource/ProblemResource.java | |||
@@ -25,7 +25,6 @@ import org.eclipse.xtext.resource.DerivedStateAwareResource; | |||
25 | import org.eclipse.xtext.util.Triple; | 25 | import org.eclipse.xtext.util.Triple; |
26 | import org.jetbrains.annotations.Nullable; | 26 | import org.jetbrains.annotations.Nullable; |
27 | import tools.refinery.language.model.problem.Problem; | 27 | import tools.refinery.language.model.problem.Problem; |
28 | import tools.refinery.language.parser.ProblemEcoreElementFactory; | ||
29 | import tools.refinery.language.utils.ProblemUtil; | 28 | import tools.refinery.language.utils.ProblemUtil; |
30 | 29 | ||
31 | import java.util.Arrays; | 30 | import java.util.Arrays; |
@@ -48,7 +47,11 @@ public class ProblemResource extends DerivedStateAwareResource { | |||
48 | protected void updateInternalState(IParseResult oldParseResult, IParseResult newParseResult) { | 47 | protected void updateInternalState(IParseResult oldParseResult, IParseResult newParseResult) { |
49 | if (isNewRootElement(oldParseResult, newParseResult) && | 48 | if (isNewRootElement(oldParseResult, newParseResult) && |
50 | newParseResult.getRootASTElement() instanceof Problem newRootProblem && | 49 | newParseResult.getRootASTElement() instanceof Problem newRootProblem && |
51 | !ProblemEcoreElementFactory.hasExplicitlySetProblemKind(newRootProblem)) { | 50 | !newRootProblem.isExplicitKind()) { |
51 | // Post-process the parsed model to set its URI-dependent module kind. | ||
52 | // We can't set the default module kind in {@link tools.refinery.language.serializer | ||
53 | // .ProblemTransientValueService}, because the {@link Problem} does not get added into the EMF resource | ||
54 | // before parsing is fully completed. | ||
52 | var defaultModuleKind = ProblemUtil.getDefaultModuleKind(getURI()); | 55 | var defaultModuleKind = ProblemUtil.getDefaultModuleKind(getURI()); |
53 | newRootProblem.setKind(defaultModuleKind); | 56 | newRootProblem.setKind(defaultModuleKind); |
54 | } | 57 | } |
diff --git a/subprojects/language/src/main/java/tools/refinery/language/serializer/ProblemTransientValueService.java b/subprojects/language/src/main/java/tools/refinery/language/serializer/ProblemTransientValueService.java index c364b30b..269e1243 100644 --- a/subprojects/language/src/main/java/tools/refinery/language/serializer/ProblemTransientValueService.java +++ b/subprojects/language/src/main/java/tools/refinery/language/serializer/ProblemTransientValueService.java | |||
@@ -10,7 +10,6 @@ import org.eclipse.emf.ecore.EStructuralFeature; | |||
10 | import org.eclipse.xtext.parsetree.reconstr.impl.DefaultTransientValueService; | 10 | import org.eclipse.xtext.parsetree.reconstr.impl.DefaultTransientValueService; |
11 | import tools.refinery.language.model.problem.Problem; | 11 | import tools.refinery.language.model.problem.Problem; |
12 | import tools.refinery.language.model.problem.ProblemPackage; | 12 | import tools.refinery.language.model.problem.ProblemPackage; |
13 | import tools.refinery.language.parser.ProblemEcoreElementFactory; | ||
14 | import tools.refinery.language.utils.ProblemUtil; | 13 | import tools.refinery.language.utils.ProblemUtil; |
15 | 14 | ||
16 | public class ProblemTransientValueService extends DefaultTransientValueService { | 15 | public class ProblemTransientValueService extends DefaultTransientValueService { |
@@ -18,7 +17,7 @@ public class ProblemTransientValueService extends DefaultTransientValueService { | |||
18 | public boolean isTransient(EObject owner, EStructuralFeature feature, int index) { | 17 | public boolean isTransient(EObject owner, EStructuralFeature feature, int index) { |
19 | if (owner instanceof Problem problem && feature == ProblemPackage.Literals.PROBLEM__KIND) { | 18 | if (owner instanceof Problem problem && feature == ProblemPackage.Literals.PROBLEM__KIND) { |
20 | return problem.getName() == null && problem.getKind() == ProblemUtil.getDefaultModuleKind(problem) && | 19 | return problem.getName() == null && problem.getKind() == ProblemUtil.getDefaultModuleKind(problem) && |
21 | !ProblemEcoreElementFactory.hasExplicitlySetProblemKind(problem); | 20 | !problem.isExplicitKind(); |
22 | } | 21 | } |
23 | return super.isTransient(owner, feature, index); | 22 | return super.isTransient(owner, feature, index); |
24 | } | 23 | } |