Skip to content

Commit f57ce89

Browse files
authored
Add files via upload
1 parent 62ca8b7 commit f57ce89

File tree

71 files changed

+10782
-0
lines changed

Some content is hidden

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

71 files changed

+10782
-0
lines changed

version24/IOSAppGenerator.class

103 KB
Binary file not shown.

version24/IOSAppGenerator.java

Lines changed: 4093 additions & 0 deletions
Large diffs are not rendered by default.

version24/Identifier.class

730 Bytes
Binary file not shown.

version24/Identifier.java

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
/******************************
2+
* Copyright (c) 2003--2023 Kevin Lano
3+
* This program and the accompanying materials are made available under the
4+
* terms of the Eclipse Public License 2.0 which is available at
5+
* http://www.eclipse.org/legal/epl-2.0
6+
*
7+
* SPDX-License-Identifier: EPL-2.0
8+
* *****************************/
9+
/* Package: Utilities */
10+
11+
public class Identifier
12+
{ private static int count = 0;
13+
14+
public static String nextIdentifier(String pfx)
15+
{ String res = pfx + count;
16+
count++;
17+
return res;
18+
}
19+
20+
public static String nextIdentifier(int incr, String pfx)
21+
{ count = count + incr;
22+
String res = pfx + count;
23+
count++;
24+
return res;
25+
}
26+
}
27+

version24/IfCase.class

9.03 KB
Binary file not shown.

version24/IfStatement.class

17.6 KB
Binary file not shown.
9.08 KB
Binary file not shown.

version24/InPattern.class

3.2 KB
Binary file not shown.

version24/InPattern.java

Lines changed: 148 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,148 @@
1+
import java.util.Vector;
2+
3+
/******************************
4+
* Copyright (c) 2003-2023 Kevin Lano
5+
* This program and the accompanying materials are made available under the
6+
* terms of the Eclipse Public License 2.0 which is available at
7+
* http://www.eclipse.org/legal/epl-2.0
8+
*
9+
* SPDX-License-Identifier: EPL-2.0
10+
* *****************************/
11+
/* Package: ATL */
12+
13+
public class InPattern
14+
{ Vector elements; // of InPatternElement
15+
16+
public InPattern()
17+
{ elements = new Vector(); }
18+
19+
public void setElements(Vector elems)
20+
{ elements = elems; }
21+
22+
public void addElement(InPatternElement ipe)
23+
{ elements.add(ipe); }
24+
25+
public int size()
26+
{ return elements.size(); }
27+
28+
public String toString()
29+
{ String res = "from ";
30+
for (int i = 0; i < elements.size(); i++)
31+
{ InPatternElement ipe = (InPatternElement) elements.get(i);
32+
res = res + " " + ipe;
33+
if (i < elements.size() - 1)
34+
{ res = res + ",\n"; }
35+
}
36+
return res;
37+
}
38+
39+
public String firstType() // Will become the owner of the constraint of the rule
40+
{ if (elements.size() > 0)
41+
{ InPatternElement ipe =
42+
(InPatternElement) elements.get(0);
43+
return ipe.getType();
44+
}
45+
return null;
46+
}
47+
48+
public Entity firstEntity()
49+
{ if (elements.size() > 0)
50+
{ InPatternElement ipe =
51+
(InPatternElement) elements.get(0);
52+
if (ipe.variable == null)
53+
{ return null; }
54+
Type typ = ipe.variable.getType();
55+
if (typ.isEntity())
56+
{ return typ.getEntity(); }
57+
}
58+
return null;
59+
}
60+
61+
public boolean hasType(String typ)
62+
{ // typ occurs as a type of the pattern, or superclass of such a type
63+
64+
for (int i = 0; i < elements.size(); i++)
65+
{ InPatternElement ipe = (InPatternElement) elements.get(i);
66+
if (typ.equals(ipe.variable.getType() + ""))
67+
{ return true; }
68+
}
69+
return false;
70+
}
71+
72+
public Expression toExpression(UseCase uc)
73+
{ // pre: elements.size() > 0
74+
if (elements.size() == 0)
75+
{ return new BasicExpression(true); }
76+
77+
InPatternElement ipe0 = (InPatternElement) elements.get(0);
78+
Expression res = ipe0.condition;
79+
for (int i = 1; i < elements.size(); i++)
80+
{ InPatternElement ipe =
81+
(InPatternElement) elements.get(i);
82+
res = Expression.simplify("&",res,
83+
ipe.getFullCondition(uc),null);
84+
}
85+
return res;
86+
}
87+
88+
public Vector allVariables()
89+
{ Vector res = new Vector();
90+
for (int i = 0; i < elements.size(); i++)
91+
{ InPatternElement ipe =
92+
(InPatternElement) elements.get(i);
93+
if (ipe.variable != null)
94+
{ res.add(ipe.variable); }
95+
}
96+
return res;
97+
}
98+
99+
public Vector allVariablesAsExpressions()
100+
{ Vector res = new Vector();
101+
for (int i = 0; i < elements.size(); i++)
102+
{ InPatternElement ipe =
103+
(InPatternElement) elements.get(i);
104+
if (ipe.variable != null)
105+
{ res.add(new BasicExpression(ipe.variable)); }
106+
}
107+
return res;
108+
}
109+
110+
public int complexity()
111+
{ int result = 0;
112+
for (int i = 0; i < elements.size(); i++)
113+
{ InPatternElement ipe = (InPatternElement) elements.get(i);
114+
result = result + ipe.complexity();
115+
}
116+
return result;
117+
}
118+
119+
public int cyclomaticComplexity()
120+
{ int result = 0;
121+
for (int i = 0; i < elements.size(); i++)
122+
{ InPatternElement ipe = (InPatternElement) elements.get(i);
123+
result = result + ipe.cyclomaticComplexity();
124+
}
125+
return result;
126+
}
127+
128+
public Vector operationsUsedIn()
129+
{ Vector res = new Vector();
130+
for (int i = 0; i < elements.size(); i++)
131+
{ InPatternElement ipe = (InPatternElement) elements.get(i);
132+
if (ipe.condition != null)
133+
{ res.addAll(ipe.condition.allOperationsUsedIn()); }
134+
}
135+
return res;
136+
}
137+
138+
public Vector getUses(String data)
139+
{ Vector res = new Vector();
140+
for (int i = 0; i < elements.size(); i++)
141+
{ InPatternElement ipe = (InPatternElement) elements.get(i);
142+
if (ipe.condition != null)
143+
{ res.addAll(ipe.condition.getUses(data)); }
144+
}
145+
return res;
146+
}
147+
148+
}

version24/InPatternElement.class

1.86 KB
Binary file not shown.

0 commit comments

Comments
 (0)