-
Notifications
You must be signed in to change notification settings - Fork 297
/
GetModelInstanceEnum2.mos
88 lines (85 loc) · 2.06 KB
/
GetModelInstanceEnum2.mos
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
78
79
80
81
82
83
84
85
86
87
88
// name: GetModelInstanceEnum2
// keywords:
// status: correct
// cflags: -d=newInst
//
//
loadString("
model M
type E1 = enumeration(a \"a\", b \"b\", c \"c\");
type E2 = E1;
parameter E2 e;
end M;
");
getModelInstance(M, prettyPrint=true);
// Result:
// true
// "{
// \"name\": \"M\",
// \"restriction\": \"model\",
// \"elements\": [
// {
// \"$kind\": \"component\",
// \"name\": \"e\",
// \"type\": {
// \"name\": \"E2\",
// \"restriction\": \"type\",
// \"elements\": [
// {
// \"$kind\": \"extends\",
// \"baseClass\": {
// \"name\": \"E1\",
// \"restriction\": \"type\",
// \"elements\": [
// {
// \"$kind\": \"extends\",
// \"baseClass\": \"enumeration\"
// }
// ],
// \"source\": {
// \"filename\": \"<interactive>\",
// \"lineStart\": 3,
// \"columnStart\": 5,
// \"lineEnd\": 3,
// \"columnEnd\": 47
// }
// }
// },
// {
// \"$kind\": \"component\",
// \"name\": \"a\",
// \"comment\": \"a\"
// },
// {
// \"$kind\": \"component\",
// \"name\": \"b\",
// \"comment\": \"b\"
// },
// {
// \"$kind\": \"component\",
// \"name\": \"c\",
// \"comment\": \"c\"
// }
// ],
// \"source\": {
// \"filename\": \"<interactive>\",
// \"lineStart\": 4,
// \"columnStart\": 5,
// \"lineEnd\": 4,
// \"columnEnd\": 17
// }
// },
// \"prefixes\": {
// \"variability\": \"parameter\"
// }
// }
// ],
// \"source\": {
// \"filename\": \"<interactive>\",
// \"lineStart\": 2,
// \"columnStart\": 3,
// \"lineEnd\": 6,
// \"columnEnd\": 8
// }
// }"
// endResult