Skip to content

Commit 4fd9ba7

Browse files
committed
KERML_-58 Updated LoopAction and subclasses for proper parameter redefs.
- Also changed parameter order for LoopPerformance so untilTest comes after body.
1 parent 977fa78 commit 4fd9ba7

9 files changed

Lines changed: 37 additions & 397 deletions

File tree

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,13 @@ package Expressions {
2121
behavior w { inout v : Integer;
2222
step : ControlPerformances::LoopPerformance {
2323
in expr whileTest {v > 3}
24-
in expr untilTest;
2524
in step body {
2625
step decrement {
2726
out v_decr : Integer = v - 1;
2827
}
2928
succession decrement then update;
3029
step update : FeatureReferencingPerformances::FeatureWritePerformance {
31-
in redefines onOccurrence = w::self {
30+
in onOccurrence = w::self {
3231
feature redefines startingAt : w {
3332
inout feature redefines accessedFeature redefines v;
3433
}

org.omg.kerml.xpect.tests/library/ControlPerformances.kerml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,8 +116,8 @@ standard library package ControlPerformances {
116116
*/
117117

118118
in whileTest : BooleanEvaluation[1..*];
119-
in untilTest : BooleanEvaluation[0..*];
120119
in body : Occurrence[0..*];
120+
in untilTest : BooleanEvaluation[0..*];
121121

122122
step whileDecision : IfThenPerformance[1..*];
123123
step untilDecision : IfElsePerformance[0..*];

org.omg.kerml.xpect.tests/src/org/omg/kerml/xpect/tests/parsing/ParsingTests_Expressions.kerml.xt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,14 +62,13 @@ package Expressions {
6262
inout v : Integer;
6363
step : ControlPerformances::LoopPerformance {
6464
in expr whileTest {v > 3}
65-
in expr untilTest;
6665
in step body {
6766
step decrement {
6867
out v_decr : Integer = v - 1;
6968
}
7069
succession decrement then update;
7170
step update : FeatureReferencingPerformances::FeatureWritePerformance {
72-
in redefines onOccurrence = w::self {
71+
in onOccurrence = w::self {
7372
feature redefines startingAt : w {
7473
inout feature redefines accessedFeature redefines v;
7574
}

org.omg.sysml.xpect.tests/library.kernel/ControlPerformances.kerml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ standard library package ControlPerformances {
3131
* successions going out of a decision step.
3232
*/
3333

34-
feature redefines earlierOccurrence subsets that;
34+
end feature redefines earlierOccurrence subsets that;
3535
}
3636
}
3737

@@ -52,7 +52,7 @@ standard library package ControlPerformances {
5252
* successions coming into a merge step.
5353
*/
5454

55-
feature redefines laterOccurrence subsets that;
55+
end feature redefines laterOccurrence subsets that;
5656
}
5757
}
5858

@@ -116,8 +116,8 @@ standard library package ControlPerformances {
116116
*/
117117

118118
in whileTest : BooleanEvaluation[1..*];
119-
in untilTest : BooleanEvaluation[0..*];
120119
in body : Occurrence[0..*];
120+
in untilTest : BooleanEvaluation[0..*];
121121

122122
step whileDecision : IfThenPerformance[1..*];
123123
step untilDecision : IfElsePerformance[0..*];

org.omg.sysml.xpect.tests/library.systems/Actions.sysml

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -431,6 +431,7 @@ standard library package Actions {
431431
* A LoopAction is the base type for all LoopActionUsages.
432432
*/
433433

434+
in ref iterator;
434435

435436
in action body[0..*] {
436437
doc
@@ -447,7 +448,7 @@ standard library package Actions {
447448
* It is the base type for all WhileLoopActionUsages.
448449
*/
449450

450-
in :>> whileTest default {true} {
451+
in whileTest default {true} {
451452
doc
452453
/*
453454
* A Boolean expression that must be true for the loop to continue.
@@ -456,15 +457,15 @@ standard library package Actions {
456457
*/
457458
}
458459

459-
in action body :>> LoopAction::body, LoopPerformance::body {
460+
in action body {
460461
doc
461462
/*
462463
* The action that is performed while the whileTest is true and the
463464
* untilTest is false.
464465
*/
465466
}
466467

467-
in :>> untilTest default {false} {
468+
in untilTest default {false} {
468469
doc
469470
/*
470471
* A Boolean expression that must be false for the loop to continue.
@@ -473,12 +474,7 @@ standard library package Actions {
473474
}
474475
}
475476

476-
private abstract action def ForLoopActionBase :> LoopAction {
477-
in action body;
478-
in ref seq[0..*] ordered nonunique;
479-
}
480-
481-
action def ForLoopAction :> ForLoopActionBase {
477+
action def ForLoopAction :> LoopAction {
482478
doc
483479
/*
484480
* A ForLoopAction is a LoopAction that iterates over an ordered sequence of values.
@@ -493,14 +489,14 @@ standard library package Actions {
493489
*/
494490
}
495491

496-
in ref :>> seq {
492+
in ref seq {
497493
doc
498494
/*
499495
* The sequence of values over which the loop iterates.
500496
*/
501497
}
502498

503-
in action :>> body {
499+
in action body {
504500
doc
505501
/*
506502
* The action that is performed on each iteration of the loop.

0 commit comments

Comments
 (0)