-
Notifications
You must be signed in to change notification settings - Fork 297
/
Obfuscation3.mos
64 lines (56 loc) · 1 KB
/
Obfuscation3.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
// name: Obfuscation3
// keywords:
// status: correct
// cflags: -d=newInst
//
setCommandLineOptions("--obfuscate=protected");
loadString("
package P1
annotation(Protection(access = Access.hide));
model A
Real x \"x\";
end A;
end P1;
package P2
model A
Real x \"x2\";
end A;
model B
Real y \"y\";
protected
Real z \"z\";
annotation(Protection(access = Access.icon));
end B;
model C
extends B;
Real w \"w\";
protected
Real u \"u\";
annotation(Protection(access = Access.packageText));
end C;
end P2;
model M
P1.A a1;
P2.A a2;
protected
P2.B b1;
P2.C c1;
end M;
");
instantiateModel(M); getErrorString();
// Result:
// true
// true
// "class M
// Real a1.x;
// Real a2.x \"x2\";
// protected Real n1.n2;
// protected Real n1.n3;
// protected Real n4.n5;
// protected Real n4.n6;
// protected Real n4.n7 \"w\";
// protected Real n4.n8 \"u\";
// end M;
// "
// ""
// endResult