-
-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathparser_features_demo_edge_cases.kerml
More file actions
77 lines (59 loc) · 2.08 KB
/
Copy pathparser_features_demo_edge_cases.kerml
File metadata and controls
77 lines (59 loc) · 2.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
/*
* Parser Features Demo: Edge Cases & Advanced Patterns
*
* Demonstrates edge case handling (Tasks 62, 67, 70, 90).
* All patterns extracted from actual stdlib files.
*/
package EdgeCasesAndAdvanced {
// The library is not implicitly visible: a bare name needs an import.
private import ScalarValues::*;
private import StatePerformances::StatePerformance;
// ===== Keywords as Feature Names in Expressions (Task 70) =====
// From StatePerformances.kerml line 77-90
// Keywords like 'exit', 'entry' can appear in feature chain expressions
function testKeywordAccess {
in oSP: StatePerformance;
in thatSP: StatePerformance;
return result: Boolean =
oSP.exit == thatSP.exit;
}
// ===== Identifier-Based Multiplicities (Task 70) =====
// From TransitionPerformances.kerml
feature ProcessFlow {
feature itemCount: Natural;
step initialize[1];
step process[1];
succession items [itemCount]
first [1] initialize
then [1] process;
}
// ===== Binding Connectors in a Behavior Body (Task 62) =====
// From TransitionPerformances.kerml
// 'binding' binds a feature to a feature of a nested step
behavior AcceptingTransition {
inout payload[0..*];
feature receiver[0..1];
step accepter {
inout payload[0..*];
feature receiver[0..1];
}
binding payload = accepter.payload;
binding receiver = accepter.receiver;
}
// ===== Step Usage with 'do' as Name (Task 67) =====
// From StatePerformances.kerml
feature StatePerformanceSteps {
abstract step middle[1..*];
step entry[1];
step do[1] subsets middle;
step exit[1];
}
// ===== Feature with Body (Task 90) =====
// From Transfers.kerml
feature payload [0..*] {
doc
/* Reference with body */
feature dataType: String;
feature size: Integer;
}
}