Skip to content

Commit 7c4a6fc

Browse files
committed
SYSML2_-262 Updated control node syntax with full action bodies.
- Also reduced parser splitter count to 18. - Updated ControlNodeTest for control nodes with parameters.
1 parent b65a823 commit 7c4a6fc

27 files changed

Lines changed: 33482 additions & 33491 deletions

org.omg.sysml.xpect.tests/src/org/omg/sysml/xpect/tests/simpletests/ControlNodeTest.sysml.xt

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ XPECT_SETUP org.omg.sysml.xpect.tests.simpletests.SysMLTests
1414
File {from ="/library.systems/Parts.sysml"}
1515
File {from ="/library.systems/Ports.sysml"}
1616
File {from ="/library.systems/Actions.sysml"}
17+
File {from ="/library.systems/Flows.sysml"}
1718
}
1819
Workspace {
1920
JavaProject {
@@ -31,6 +32,7 @@ XPECT_SETUP org.omg.sysml.xpect.tests.simpletests.SysMLTests
3132
File {from ="/library.systems/Parts.sysml"}
3233
File {from ="/library.systems/Ports.sysml"}
3334
File {from ="/library.systems/Actions.sysml"}
35+
File {from ="/library.systems/Flows.sysml"}
3436
}
3537
}
3638
}
@@ -41,14 +43,29 @@ action def ControlNodeTest {
4143
action A1;
4244
then J;
4345

44-
action A2;
46+
action A2 {
47+
out a;
48+
}
4549
then J;
4650

51+
flow A2.a to F.a;
52+
4753
join J;
48-
then fork F;
54+
then fork F {
55+
in a;
56+
out b1;
57+
out b2;
58+
}
4959
then B1;
5060
then B2;
61+
62+
flow F.b1 to B1.b;
63+
flow F.b2 to B2.b;
5164

52-
action B1;
53-
action B2;
65+
action B1 {
66+
in b;
67+
}
68+
action B2 {
69+
in b;
70+
}
5471
}
Lines changed: 21 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,24 @@
11
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
22
<launchConfiguration type="org.eclipse.emf.mwe2.launch.Mwe2LaunchConfigurationType">
3-
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
4-
<listEntry value="/org.omg.sysml.xtext"/>
5-
</listAttribute>
6-
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
7-
<listEntry value="4"/>
8-
</listAttribute>
9-
<listAttribute key="org.eclipse.debug.ui.favoriteGroups">
10-
<listEntry value="org.eclipse.debug.ui.launchGroup.debug"/>
11-
<listEntry value="org.eclipse.debug.ui.launchGroup.run"/>
12-
</listAttribute>
13-
<stringAttribute key="org.eclipse.debug.core.ATTR_REFRESH_SCOPE" value="${working_set:&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;&#10;&lt;resources&gt;&#10;&lt;item path=&quot;/org.omg.sysml.xtext&quot; type=&quot;4&quot;/&gt;&#10;&lt;item path=&quot;/org.omg.sysml.xtext.ide&quot; type=&quot;4&quot;/&gt;&#10;&lt;item path=&quot;/org.omg.sysml.xtext.ui&quot; type=&quot;4&quot;/&gt;&#10;&lt;item path=&quot;/org.omg.sysml.xtext.tests&quot; type=&quot;4&quot;/&gt;&#10;&lt;item path=&quot;/org.omg.sysml.xtext.ui.tests&quot; type=&quot;4&quot;/&gt;&#10;&lt;item path=&quot;/org.omg.sysml.xtext.tests&quot; type=&quot;4&quot;/&gt;&#10;&lt;item path=&quot;/org.omg.sysml.xtext.ui.tests&quot; type=&quot;4&quot;/&gt;&#10;;&lt;/resources&gt;}"/>
14-
<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="org.eclipse.emf.mwe2.launch.runtime.Mwe2Launcher"/>
15-
<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="org.omg.sysml.xtext.GenerateSysML"/>
16-
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="org.omg.sysml.xtext"/>
17-
<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Xmx10g"/>
3+
<booleanAttribute key="org.eclipse.debug.core.ATTR_FORCE_SYSTEM_CONSOLE_ENCODING" value="false"/>
4+
<stringAttribute key="org.eclipse.debug.core.ATTR_REFRESH_SCOPE" value="${working_set:&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;&#10;&lt;resources&gt;&#10;&lt;item path=&quot;/org.omg.sysml.xtext&quot; type=&quot;4&quot;/&gt;&#10;&lt;item path=&quot;/org.omg.sysml.xtext.ide&quot; type=&quot;4&quot;/&gt;&#10;&lt;item path=&quot;/org.omg.sysml.xtext.ui&quot; type=&quot;4&quot;/&gt;&#10;&lt;item path=&quot;/org.omg.sysml.xtext.tests&quot; type=&quot;4&quot;/&gt;&#10;&lt;item path=&quot;/org.omg.sysml.xtext.ui.tests&quot; type=&quot;4&quot;/&gt;&#10;&lt;item path=&quot;/org.omg.sysml.xtext.tests&quot; type=&quot;4&quot;/&gt;&#10;&lt;item path=&quot;/org.omg.sysml.xtext.ui.tests&quot; type=&quot;4&quot;/&gt;&#10;&lt;/resources&gt;}"/>
5+
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
6+
<listEntry value="/org.omg.sysml.xtext"/>
7+
</listAttribute>
8+
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
9+
<listEntry value="4"/>
10+
</listAttribute>
11+
<listAttribute key="org.eclipse.debug.ui.favoriteGroups">
12+
<listEntry value="org.eclipse.debug.ui.launchGroup.debug"/>
13+
<listEntry value="org.eclipse.debug.ui.launchGroup.run"/>
14+
</listAttribute>
15+
<booleanAttribute key="org.eclipse.jdt.launching.ATTR_ATTR_USE_ARGFILE" value="false"/>
16+
<booleanAttribute key="org.eclipse.jdt.launching.ATTR_SHOW_CODEDETAILS_IN_EXCEPTION_MESSAGES" value="true"/>
17+
<booleanAttribute key="org.eclipse.jdt.launching.ATTR_USE_CLASSPATH_ONLY_JAR" value="false"/>
18+
<booleanAttribute key="org.eclipse.jdt.launching.ATTR_USE_START_ON_FIRST_THREAD" value="true"/>
19+
<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="org.eclipse.emf.mwe2.launch.runtime.Mwe2Launcher"/>
20+
<stringAttribute key="org.eclipse.jdt.launching.MODULE_NAME" value="org.omg.sysml.xtext"/>
21+
<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="org.omg.sysml.xtext.GenerateSysML"/>
22+
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="org.omg.sysml.xtext"/>
23+
<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Xmx10g"/>
1824
</launchConfiguration>
-22 Bytes
Binary file not shown.

org.omg.sysml.xtext/src-gen/org/omg/sysml/xtext/parser/antlr/internal/InternalSysML.g

Lines changed: 68 additions & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -16182,10 +16182,20 @@ ruleMergeNode returns [EObject current=null]
1618216182
$current = $this_ControlNodePrefix_0.current;
1618316183
afterParserOrEnumRuleCall();
1618416184
}
16185-
otherlv_1='merge'
16186-
{
16187-
newLeafNode(otherlv_1, grammarAccess.getMergeNodeAccess().getMergeKeyword_1());
16188-
}
16185+
(
16186+
(
16187+
lv_isComposite_1_0='merge'
16188+
{
16189+
newLeafNode(lv_isComposite_1_0, grammarAccess.getMergeNodeAccess().getIsCompositeMergeKeyword_1_0());
16190+
}
16191+
{
16192+
if ($current==null) {
16193+
$current = createModelElement(grammarAccess.getMergeNodeRule());
16194+
}
16195+
setWithLastConsumed($current, "isComposite", lv_isComposite_1_0 != null, "merge");
16196+
}
16197+
)
16198+
)
1618916199
(
1619016200
{
1619116201
if ($current==null) {
@@ -16203,11 +16213,11 @@ ruleMergeNode returns [EObject current=null]
1620316213
if ($current==null) {
1620416214
$current = createModelElement(grammarAccess.getMergeNodeRule());
1620516215
}
16206-
newCompositeNode(grammarAccess.getMergeNodeAccess().getActionNodeBodyParserRuleCall_3());
16216+
newCompositeNode(grammarAccess.getMergeNodeAccess().getActionBodyParserRuleCall_3());
1620716217
}
16208-
this_ActionNodeBody_3=ruleActionNodeBody[$current]
16218+
this_ActionBody_3=ruleActionBody[$current]
1620916219
{
16210-
$current = $this_ActionNodeBody_3.current;
16220+
$current = $this_ActionBody_3.current;
1621116221
afterParserOrEnumRuleCall();
1621216222
}
1621316223
)
@@ -16240,10 +16250,20 @@ ruleDecisionNode returns [EObject current=null]
1624016250
$current = $this_ControlNodePrefix_0.current;
1624116251
afterParserOrEnumRuleCall();
1624216252
}
16243-
otherlv_1='decide'
16244-
{
16245-
newLeafNode(otherlv_1, grammarAccess.getDecisionNodeAccess().getDecideKeyword_1());
16246-
}
16253+
(
16254+
(
16255+
lv_isComposite_1_0='decide'
16256+
{
16257+
newLeafNode(lv_isComposite_1_0, grammarAccess.getDecisionNodeAccess().getIsCompositeDecideKeyword_1_0());
16258+
}
16259+
{
16260+
if ($current==null) {
16261+
$current = createModelElement(grammarAccess.getDecisionNodeRule());
16262+
}
16263+
setWithLastConsumed($current, "isComposite", lv_isComposite_1_0 != null, "decide");
16264+
}
16265+
)
16266+
)
1624716267
(
1624816268
{
1624916269
if ($current==null) {
@@ -16261,11 +16281,11 @@ ruleDecisionNode returns [EObject current=null]
1626116281
if ($current==null) {
1626216282
$current = createModelElement(grammarAccess.getDecisionNodeRule());
1626316283
}
16264-
newCompositeNode(grammarAccess.getDecisionNodeAccess().getActionNodeBodyParserRuleCall_3());
16284+
newCompositeNode(grammarAccess.getDecisionNodeAccess().getActionBodyParserRuleCall_3());
1626516285
}
16266-
this_ActionNodeBody_3=ruleActionNodeBody[$current]
16286+
this_ActionBody_3=ruleActionBody[$current]
1626716287
{
16268-
$current = $this_ActionNodeBody_3.current;
16288+
$current = $this_ActionBody_3.current;
1626916289
afterParserOrEnumRuleCall();
1627016290
}
1627116291
)
@@ -16298,10 +16318,20 @@ ruleJoinNode returns [EObject current=null]
1629816318
$current = $this_ControlNodePrefix_0.current;
1629916319
afterParserOrEnumRuleCall();
1630016320
}
16301-
otherlv_1='join'
16302-
{
16303-
newLeafNode(otherlv_1, grammarAccess.getJoinNodeAccess().getJoinKeyword_1());
16304-
}
16321+
(
16322+
(
16323+
lv_isComposite_1_0='join'
16324+
{
16325+
newLeafNode(lv_isComposite_1_0, grammarAccess.getJoinNodeAccess().getIsCompositeJoinKeyword_1_0());
16326+
}
16327+
{
16328+
if ($current==null) {
16329+
$current = createModelElement(grammarAccess.getJoinNodeRule());
16330+
}
16331+
setWithLastConsumed($current, "isComposite", lv_isComposite_1_0 != null, "join");
16332+
}
16333+
)
16334+
)
1630516335
(
1630616336
{
1630716337
if ($current==null) {
@@ -16319,11 +16349,11 @@ ruleJoinNode returns [EObject current=null]
1631916349
if ($current==null) {
1632016350
$current = createModelElement(grammarAccess.getJoinNodeRule());
1632116351
}
16322-
newCompositeNode(grammarAccess.getJoinNodeAccess().getActionNodeBodyParserRuleCall_3());
16352+
newCompositeNode(grammarAccess.getJoinNodeAccess().getActionBodyParserRuleCall_3());
1632316353
}
16324-
this_ActionNodeBody_3=ruleActionNodeBody[$current]
16354+
this_ActionBody_3=ruleActionBody[$current]
1632516355
{
16326-
$current = $this_ActionNodeBody_3.current;
16356+
$current = $this_ActionBody_3.current;
1632716357
afterParserOrEnumRuleCall();
1632816358
}
1632916359
)
@@ -16356,10 +16386,20 @@ ruleForkNode returns [EObject current=null]
1635616386
$current = $this_ControlNodePrefix_0.current;
1635716387
afterParserOrEnumRuleCall();
1635816388
}
16359-
otherlv_1='fork'
16360-
{
16361-
newLeafNode(otherlv_1, grammarAccess.getForkNodeAccess().getForkKeyword_1());
16362-
}
16389+
(
16390+
(
16391+
lv_isComposite_1_0='fork'
16392+
{
16393+
newLeafNode(lv_isComposite_1_0, grammarAccess.getForkNodeAccess().getIsCompositeForkKeyword_1_0());
16394+
}
16395+
{
16396+
if ($current==null) {
16397+
$current = createModelElement(grammarAccess.getForkNodeRule());
16398+
}
16399+
setWithLastConsumed($current, "isComposite", lv_isComposite_1_0 != null, "fork");
16400+
}
16401+
)
16402+
)
1636316403
(
1636416404
{
1636516405
if ($current==null) {
@@ -16377,63 +16417,16 @@ ruleForkNode returns [EObject current=null]
1637716417
if ($current==null) {
1637816418
$current = createModelElement(grammarAccess.getForkNodeRule());
1637916419
}
16380-
newCompositeNode(grammarAccess.getForkNodeAccess().getActionNodeBodyParserRuleCall_3());
16420+
newCompositeNode(grammarAccess.getForkNodeAccess().getActionBodyParserRuleCall_3());
1638116421
}
16382-
this_ActionNodeBody_3=ruleActionNodeBody[$current]
16422+
this_ActionBody_3=ruleActionBody[$current]
1638316423
{
16384-
$current = $this_ActionNodeBody_3.current;
16424+
$current = $this_ActionBody_3.current;
1638516425
afterParserOrEnumRuleCall();
1638616426
}
1638716427
)
1638816428
;
1638916429

16390-
16391-
// Rule ActionNodeBody
16392-
ruleActionNodeBody[EObject in_current] returns [EObject current=in_current]
16393-
@init {
16394-
enterRule();
16395-
}
16396-
@after {
16397-
leaveRule();
16398-
}:
16399-
(
16400-
otherlv_0=';'
16401-
{
16402-
newLeafNode(otherlv_0, grammarAccess.getActionNodeBodyAccess().getSemicolonKeyword_0());
16403-
}
16404-
|
16405-
(
16406-
otherlv_1='{'
16407-
{
16408-
newLeafNode(otherlv_1, grammarAccess.getActionNodeBodyAccess().getLeftCurlyBracketKeyword_1_0());
16409-
}
16410-
(
16411-
(
16412-
{
16413-
newCompositeNode(grammarAccess.getActionNodeBodyAccess().getOwnedRelationshipAnnotatingMemberParserRuleCall_1_1_0());
16414-
}
16415-
lv_ownedRelationship_2_0=ruleAnnotatingMember
16416-
{
16417-
if ($current==null) {
16418-
$current = createModelElementForParent(grammarAccess.getActionNodeBodyRule());
16419-
}
16420-
add(
16421-
$current,
16422-
"ownedRelationship",
16423-
lv_ownedRelationship_2_0,
16424-
"org.omg.sysml.xtext.SysML.AnnotatingMember");
16425-
afterParserOrEnumRuleCall();
16426-
}
16427-
)
16428-
)*
16429-
otherlv_3='}'
16430-
{
16431-
newLeafNode(otherlv_3, grammarAccess.getActionNodeBodyAccess().getRightCurlyBracketKeyword_1_2());
16432-
}
16433-
)
16434-
)
16435-
;
16436-
1643716430
// Entry rule entryRuleEmptyParameterMember
1643816431
entryRuleEmptyParameterMember returns [EObject current=null]:
1643916432
{ newCompositeNode(grammarAccess.getEmptyParameterMemberRule()); }

0 commit comments

Comments
 (0)