Skip to content

Commit a8a7d2f

Browse files
committed
Merge pull request #638 from Systems-Modeling/ST6RI-818
ST6RI-818 Constructor expressions (KERML_-132/222, SYSML2_-766) - Also set InternalParserSplitter count to 20 in GenerateSysML.mwe2, in order to get sufficient splitting.
2 parents 798f141 + 574b6c2 commit a8a7d2f

134 files changed

Lines changed: 58646 additions & 56236 deletions

File tree

Some content is hidden

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

kerml/src/examples/Simple Tests/ArgumentResolution.kerml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ package ArgumentResolutionBug {
55

66
behavior B {
77
in feature x;
8-
out feature : A = A(x);
8+
out feature : A = new A(x);
99
}
1010

1111
class C {

kerml/src/examples/Simple Tests/Expressions.kerml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,6 @@ package Expressions {
7070
feature count : ScalarValues::Integer = c#(1).count;
7171
}
7272

73-
feature l = L();
73+
feature l = new L();
7474
feature w1 = w(xx);
7575
}
Binary file not shown.

org.omg.kerml.expressions.xtext/src-gen/org/omg/kerml/expressions/xtext/parser/antlr/internal/InternalKerMLExpressions.g

Lines changed: 191 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -2938,9 +2938,9 @@ rulePrimaryExpression returns [EObject current=null]
29382938
(
29392939
(
29402940
{
2941-
newCompositeNode(grammarAccess.getPrimaryExpressionAccess().getOwnedRelationshipReferenceTypingParserRuleCall_2_0_2_2_0());
2941+
newCompositeNode(grammarAccess.getPrimaryExpressionAccess().getOwnedRelationshipInstantiatedTypeMemberParserRuleCall_2_0_2_2_0());
29422942
}
2943-
lv_ownedRelationship_15_0=ruleReferenceTyping
2943+
lv_ownedRelationship_15_0=ruleInstantiatedTypeMember
29442944
{
29452945
if ($current==null) {
29462946
$current = createModelElementForParent(grammarAccess.getPrimaryExpressionRule());
@@ -2949,7 +2949,7 @@ rulePrimaryExpression returns [EObject current=null]
29492949
$current,
29502950
"ownedRelationship",
29512951
lv_ownedRelationship_15_0,
2952-
"org.omg.kerml.expressions.xtext.KerMLExpressions.ReferenceTyping");
2952+
"org.omg.kerml.expressions.xtext.KerMLExpressions.InstantiatedTypeMember");
29532953
afterParserOrEnumRuleCall();
29542954
}
29552955
)
@@ -3283,6 +3283,34 @@ ruleFeatureChainMember returns [EObject current=null]
32833283
)
32843284
;
32853285

3286+
// Entry rule entryRuleOwnedFeatureChain
3287+
entryRuleOwnedFeatureChain returns [EObject current=null]:
3288+
{ newCompositeNode(grammarAccess.getOwnedFeatureChainRule()); }
3289+
iv_ruleOwnedFeatureChain=ruleOwnedFeatureChain
3290+
{ $current=$iv_ruleOwnedFeatureChain.current; }
3291+
EOF;
3292+
3293+
// Rule OwnedFeatureChain
3294+
ruleOwnedFeatureChain returns [EObject current=null]
3295+
@init {
3296+
enterRule();
3297+
}
3298+
@after {
3299+
leaveRule();
3300+
}:
3301+
{
3302+
if ($current==null) {
3303+
$current = createModelElement(grammarAccess.getOwnedFeatureChainRule());
3304+
}
3305+
newCompositeNode(grammarAccess.getOwnedFeatureChainAccess().getFeatureChainParserRuleCall());
3306+
}
3307+
this_FeatureChain_0=ruleFeatureChain[$current]
3308+
{
3309+
$current = $this_FeatureChain_0.current;
3310+
afterParserOrEnumRuleCall();
3311+
}
3312+
;
3313+
32863314
// Entry rule entryRuleBaseExpression
32873315
entryRuleBaseExpression returns [EObject current=null]:
32883316
{ newCompositeNode(grammarAccess.getBaseExpressionRule()); }
@@ -3345,30 +3373,39 @@ ruleBaseExpression returns [EObject current=null]
33453373
}
33463374
|
33473375
{
3348-
newCompositeNode(grammarAccess.getBaseExpressionAccess().getBodyExpressionParserRuleCall_5());
3376+
newCompositeNode(grammarAccess.getBaseExpressionAccess().getConstructorExpressionParserRuleCall_5());
3377+
}
3378+
this_ConstructorExpression_5=ruleConstructorExpression
3379+
{
3380+
$current = $this_ConstructorExpression_5.current;
3381+
afterParserOrEnumRuleCall();
3382+
}
3383+
|
3384+
{
3385+
newCompositeNode(grammarAccess.getBaseExpressionAccess().getBodyExpressionParserRuleCall_6());
33493386
}
3350-
this_BodyExpression_5=ruleBodyExpression
3387+
this_BodyExpression_6=ruleBodyExpression
33513388
{
3352-
$current = $this_BodyExpression_5.current;
3389+
$current = $this_BodyExpression_6.current;
33533390
afterParserOrEnumRuleCall();
33543391
}
33553392
|
33563393
(
3357-
otherlv_6='('
3394+
otherlv_7='('
33583395
{
3359-
newLeafNode(otherlv_6, grammarAccess.getBaseExpressionAccess().getLeftParenthesisKeyword_6_0());
3396+
newLeafNode(otherlv_7, grammarAccess.getBaseExpressionAccess().getLeftParenthesisKeyword_7_0());
33603397
}
33613398
{
3362-
newCompositeNode(grammarAccess.getBaseExpressionAccess().getSequenceExpressionParserRuleCall_6_1());
3399+
newCompositeNode(grammarAccess.getBaseExpressionAccess().getSequenceExpressionParserRuleCall_7_1());
33633400
}
3364-
this_SequenceExpression_7=ruleSequenceExpression
3401+
this_SequenceExpression_8=ruleSequenceExpression
33653402
{
3366-
$current = $this_SequenceExpression_7.current;
3403+
$current = $this_SequenceExpression_8.current;
33673404
afterParserOrEnumRuleCall();
33683405
}
3369-
otherlv_8=')'
3406+
otherlv_9=')'
33703407
{
3371-
newLeafNode(otherlv_8, grammarAccess.getBaseExpressionAccess().getRightParenthesisKeyword_6_2());
3408+
newLeafNode(otherlv_9, grammarAccess.getBaseExpressionAccess().getRightParenthesisKeyword_7_2());
33723409
}
33733410
)
33743411
)
@@ -3874,9 +3911,9 @@ ruleInvocationExpression returns [EObject current=null]
38743911
(
38753912
(
38763913
{
3877-
newCompositeNode(grammarAccess.getInvocationExpressionAccess().getOwnedRelationshipOwnedFeatureTypingParserRuleCall_0_0());
3914+
newCompositeNode(grammarAccess.getInvocationExpressionAccess().getOwnedRelationshipInstantiatedTypeMemberParserRuleCall_0_0());
38783915
}
3879-
lv_ownedRelationship_0_0=ruleOwnedFeatureTyping
3916+
lv_ownedRelationship_0_0=ruleInstantiatedTypeMember
38803917
{
38813918
if ($current==null) {
38823919
$current = createModelElementForParent(grammarAccess.getInvocationExpressionRule());
@@ -3885,7 +3922,7 @@ ruleInvocationExpression returns [EObject current=null]
38853922
$current,
38863923
"ownedRelationship",
38873924
lv_ownedRelationship_0_0,
3888-
"org.omg.kerml.expressions.xtext.KerMLExpressions.OwnedFeatureTyping");
3925+
"org.omg.kerml.expressions.xtext.KerMLExpressions.InstantiatedTypeMember");
38893926
afterParserOrEnumRuleCall();
38903927
}
38913928
)
@@ -3904,70 +3941,112 @@ ruleInvocationExpression returns [EObject current=null]
39043941
)
39053942
;
39063943

3907-
// Entry rule entryRuleOwnedFeatureTyping
3908-
entryRuleOwnedFeatureTyping returns [EObject current=null]:
3909-
{ newCompositeNode(grammarAccess.getOwnedFeatureTypingRule()); }
3910-
iv_ruleOwnedFeatureTyping=ruleOwnedFeatureTyping
3911-
{ $current=$iv_ruleOwnedFeatureTyping.current; }
3944+
// Entry rule entryRuleConstructorExpression
3945+
entryRuleConstructorExpression returns [EObject current=null]:
3946+
{ newCompositeNode(grammarAccess.getConstructorExpressionRule()); }
3947+
iv_ruleConstructorExpression=ruleConstructorExpression
3948+
{ $current=$iv_ruleConstructorExpression.current; }
39123949
EOF;
39133950

3914-
// Rule OwnedFeatureTyping
3915-
ruleOwnedFeatureTyping returns [EObject current=null]
3951+
// Rule ConstructorExpression
3952+
ruleConstructorExpression returns [EObject current=null]
39163953
@init {
39173954
enterRule();
39183955
}
39193956
@after {
39203957
leaveRule();
39213958
}:
39223959
(
3960+
otherlv_0='new'
3961+
{
3962+
newLeafNode(otherlv_0, grammarAccess.getConstructorExpressionAccess().getNewKeyword_0());
3963+
}
39233964
(
39243965
(
39253966
{
3926-
if ($current==null) {
3927-
$current = createModelElement(grammarAccess.getOwnedFeatureTypingRule());
3928-
}
3967+
newCompositeNode(grammarAccess.getConstructorExpressionAccess().getOwnedRelationshipInstantiatedTypeMemberParserRuleCall_1_0());
39293968
}
3969+
lv_ownedRelationship_1_0=ruleInstantiatedTypeMember
39303970
{
3931-
newCompositeNode(grammarAccess.getOwnedFeatureTypingAccess().getTypeTypeCrossReference_0_0());
3932-
}
3933-
ruleQualifiedName
3934-
{
3971+
if ($current==null) {
3972+
$current = createModelElementForParent(grammarAccess.getConstructorExpressionRule());
3973+
}
3974+
add(
3975+
$current,
3976+
"ownedRelationship",
3977+
lv_ownedRelationship_1_0,
3978+
"org.omg.kerml.expressions.xtext.KerMLExpressions.InstantiatedTypeMember");
39353979
afterParserOrEnumRuleCall();
39363980
}
39373981
)
39383982
)
3939-
|
39403983
(
39413984
(
39423985
{
3943-
newCompositeNode(grammarAccess.getOwnedFeatureTypingAccess().getOwnedRelatedElementOwnedFeatureChainParserRuleCall_1_0());
3986+
newCompositeNode(grammarAccess.getConstructorExpressionAccess().getOwnedRelationshipConstructorResultMemberParserRuleCall_2_0());
39443987
}
3945-
lv_ownedRelatedElement_1_0=ruleOwnedFeatureChain
3988+
lv_ownedRelationship_2_0=ruleConstructorResultMember
39463989
{
39473990
if ($current==null) {
3948-
$current = createModelElementForParent(grammarAccess.getOwnedFeatureTypingRule());
3991+
$current = createModelElementForParent(grammarAccess.getConstructorExpressionRule());
39493992
}
39503993
add(
39513994
$current,
3952-
"ownedRelatedElement",
3953-
lv_ownedRelatedElement_1_0,
3954-
"org.omg.kerml.expressions.xtext.KerMLExpressions.OwnedFeatureChain");
3995+
"ownedRelationship",
3996+
lv_ownedRelationship_2_0,
3997+
"org.omg.kerml.expressions.xtext.KerMLExpressions.ConstructorResultMember");
39553998
afterParserOrEnumRuleCall();
39563999
}
39574000
)
39584001
)
39594002
)
39604003
;
39614004

3962-
// Entry rule entryRuleOwnedFeatureChain
3963-
entryRuleOwnedFeatureChain returns [EObject current=null]:
3964-
{ newCompositeNode(grammarAccess.getOwnedFeatureChainRule()); }
3965-
iv_ruleOwnedFeatureChain=ruleOwnedFeatureChain
3966-
{ $current=$iv_ruleOwnedFeatureChain.current; }
4005+
// Entry rule entryRuleConstructorResultMember
4006+
entryRuleConstructorResultMember returns [EObject current=null]:
4007+
{ newCompositeNode(grammarAccess.getConstructorResultMemberRule()); }
4008+
iv_ruleConstructorResultMember=ruleConstructorResultMember
4009+
{ $current=$iv_ruleConstructorResultMember.current; }
39674010
EOF;
39684011

3969-
// Rule OwnedFeatureChain
3970-
ruleOwnedFeatureChain returns [EObject current=null]
4012+
// Rule ConstructorResultMember
4013+
ruleConstructorResultMember returns [EObject current=null]
4014+
@init {
4015+
enterRule();
4016+
}
4017+
@after {
4018+
leaveRule();
4019+
}:
4020+
(
4021+
(
4022+
{
4023+
newCompositeNode(grammarAccess.getConstructorResultMemberAccess().getOwnedRelatedElementConstructorResultParserRuleCall_0());
4024+
}
4025+
lv_ownedRelatedElement_0_0=ruleConstructorResult
4026+
{
4027+
if ($current==null) {
4028+
$current = createModelElementForParent(grammarAccess.getConstructorResultMemberRule());
4029+
}
4030+
add(
4031+
$current,
4032+
"ownedRelatedElement",
4033+
lv_ownedRelatedElement_0_0,
4034+
"org.omg.kerml.expressions.xtext.KerMLExpressions.ConstructorResult");
4035+
afterParserOrEnumRuleCall();
4036+
}
4037+
)
4038+
)
4039+
;
4040+
4041+
// Entry rule entryRuleConstructorResult
4042+
entryRuleConstructorResult returns [EObject current=null]:
4043+
{ newCompositeNode(grammarAccess.getConstructorResultRule()); }
4044+
iv_ruleConstructorResult=ruleConstructorResult
4045+
{ $current=$iv_ruleConstructorResult.current; }
4046+
EOF;
4047+
4048+
// Rule ConstructorResult
4049+
ruleConstructorResult returns [EObject current=null]
39714050
@init {
39724051
enterRule();
39734052
}
@@ -3976,17 +4055,81 @@ ruleOwnedFeatureChain returns [EObject current=null]
39764055
}:
39774056
{
39784057
if ($current==null) {
3979-
$current = createModelElement(grammarAccess.getOwnedFeatureChainRule());
4058+
$current = createModelElement(grammarAccess.getConstructorResultRule());
39804059
}
3981-
newCompositeNode(grammarAccess.getOwnedFeatureChainAccess().getFeatureChainParserRuleCall());
4060+
newCompositeNode(grammarAccess.getConstructorResultAccess().getArgumentListParserRuleCall());
39824061
}
3983-
this_FeatureChain_0=ruleFeatureChain[$current]
4062+
this_ArgumentList_0=ruleArgumentList[$current]
39844063
{
3985-
$current = $this_FeatureChain_0.current;
4064+
$current = $this_ArgumentList_0.current;
39864065
afterParserOrEnumRuleCall();
39874066
}
39884067
;
39894068

4069+
// Entry rule entryRuleInstantiatedTypeMember
4070+
entryRuleInstantiatedTypeMember returns [EObject current=null]:
4071+
{ newCompositeNode(grammarAccess.getInstantiatedTypeMemberRule()); }
4072+
iv_ruleInstantiatedTypeMember=ruleInstantiatedTypeMember
4073+
{ $current=$iv_ruleInstantiatedTypeMember.current; }
4074+
EOF;
4075+
4076+
// Rule InstantiatedTypeMember
4077+
ruleInstantiatedTypeMember returns [EObject current=null]
4078+
@init {
4079+
enterRule();
4080+
}
4081+
@after {
4082+
leaveRule();
4083+
}:
4084+
(
4085+
(
4086+
(
4087+
{
4088+
if ($current==null) {
4089+
$current = createModelElement(grammarAccess.getInstantiatedTypeMemberRule());
4090+
}
4091+
}
4092+
{
4093+
newCompositeNode(grammarAccess.getInstantiatedTypeMemberAccess().getMemberElementTypeCrossReference_0_0());
4094+
}
4095+
ruleQualifiedName
4096+
{
4097+
afterParserOrEnumRuleCall();
4098+
}
4099+
)
4100+
)
4101+
|
4102+
(
4103+
(
4104+
{
4105+
$current = forceCreateModelElement(
4106+
grammarAccess.getInstantiatedTypeMemberAccess().getOwningMembershipAction_1_0(),
4107+
$current);
4108+
}
4109+
)
4110+
(
4111+
(
4112+
{
4113+
newCompositeNode(grammarAccess.getInstantiatedTypeMemberAccess().getOwnedRelatedElementOwnedFeatureChainParserRuleCall_1_1_0());
4114+
}
4115+
lv_ownedRelatedElement_2_0=ruleOwnedFeatureChain
4116+
{
4117+
if ($current==null) {
4118+
$current = createModelElementForParent(grammarAccess.getInstantiatedTypeMemberRule());
4119+
}
4120+
add(
4121+
$current,
4122+
"ownedRelatedElement",
4123+
lv_ownedRelatedElement_2_0,
4124+
"org.omg.kerml.expressions.xtext.KerMLExpressions.OwnedFeatureChain");
4125+
afterParserOrEnumRuleCall();
4126+
}
4127+
)
4128+
)
4129+
)
4130+
)
4131+
;
4132+
39904133

39914134
// Rule FeatureChain
39924135
ruleFeatureChain[EObject in_current] returns [EObject current=in_current]

0 commit comments

Comments
 (0)