Skip to content

Commit d689826

Browse files
Merge pull request #2 from HammerMaximilian/development
development --> master
2 parents c2dea73 + b1cde0c commit d689826

File tree

414 files changed

+120097
-27
lines changed

Some content is hidden

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

414 files changed

+120097
-27
lines changed

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<img src="logo.png" width="264"/>
22

3-
# fUML Reference Implementation for *Java*
4-
This software is an open source reference implementation of the *Semantics of a Foundational Subset for Executable UML Models* (fUML) specifications by the *Object Management Group* (OMG) (see [fUML](https://www.omg.org/spec/FUML/1.5/About-FUML)). The fUML implementation of this software is a ont-on-one port of the original Java fUML reference implementation developed by
3+
# fUML/PSCS Reference Implementation for *Java*
4+
This software is an open source reference implementation of the *Semantics of a Foundational Subset for Executable UML Models* (fUML) and *Precise Semantics of UML Composite Structures* (PSCS) specifications by the *Object Management Group* (OMG) (see [fUML](https://www.omg.org/spec/FUML/1.5/About-FUML) and [PSCS](https://www.omg.org/spec/PSCS/1.2/About-PSCS)). The fUML implementation of this software is a ont-on-one port of the original Java fUML reference implementation developed by
55
*Model Driven Solutions* (see [https://github.com/ModelDriven/fUML-Reference-Implementation](https://github.com/ModelDriven/fUML-Reference-Implementation))
66

77
## Licensing
@@ -21,7 +21,7 @@ For detailed information, please see the [User Guide](fUML-Java_User_Guide.pdf)
2121
For detailed information, please see the [User Guide](fUML-Java_User_Guide.pdf) section *2. Setup*.
2222
### 1. Setting up Eclipse
2323
* Import fUML-Java root project *fUML-Java* into your workspace
24-
* Import nested projects *uml* and *fuml*
24+
* Import nested projects *uml*, *fuml* and *pscs*
2525

2626
## Building
2727
For detailed information, please see the [User Guide](fUML-Java_User_Guide.pdf) section *3. Build*.
@@ -34,8 +34,8 @@ For detailed information, please see the [User Guide](fUML-Java_User_Guide.pdf)
3434
* Create new Java project (see `"<fUML-Java-rootdir>\examples\helloworld"` as a reference project)
3535
* NOTE: it is suggested to store user-defined source code projects in common directory `"<fUML-Java-rootdir>\usersrc"`
3636
* The *usersrc* directory may contain arbitrary nested subdirectories
37-
* Add the *uml* and *fuml* projects to the classpath of your project
38-
* Create a `<model-name>Environment` class by extending class `utils.environmentfuml.Environment`
37+
* Add the *uml*, *fuml* and *pscs* (for PSCS-compatibility) projects to the classpath of your project
38+
* Create a `<model-name>Environment` class by extending class `utils.environmentfuml.Environment` (or `utils.environmentpscs.Environment` for PSCS-compatibility)
3939
* Create a `<model-name>Model` class by extending class `utils.environment.InMemoryModel` (this class will contain all of your model elements)
4040
* Create a class containing a main method and call `<model-name>Environment.instance().execute("<behavior-name>");` for each behavior you want to execute in subsequent order
4141
* Run your project as a Java application within the *Eclipse IDE*

fUML-Java/fuml/.classpath

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,6 @@
66
<attribute name="module" value="true"/>
77
</attributes>
88
</classpathentry>
9-
<classpathentry combineaccessrules="false" kind="src" path="/uml">
10-
<attributes>
11-
<attribute name="module" value="true"/>
12-
</attributes>
13-
</classpathentry>
9+
<classpathentry combineaccessrules="false" kind="src" path="/uml"/>
1410
<classpathentry kind="output" path="bin"/>
1511
</classpath>

fUML-Java/fuml/src/fuml/semantics/actions/ActionActivation.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ public boolean isReady() {
172172

173173
InputPinList inputPins = ((Action) (this.node)).input;
174174
int j = 1;
175-
while (ready & j <= inputPins.size()) {
175+
while (ready && j <= inputPins.size()) {
176176
ready = this.getPinActivation(inputPins.getValue(j - 1)).isReady();
177177
j = j + 1;
178178
}
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
package fuml.semantics.structuredclassifiers;
2+
3+
import java.util.ArrayList;
4+
5+
public class ReferenceList extends ArrayList<fuml.semantics.structuredclassifiers.Reference> {
6+
public ReferenceList() {
7+
super();
8+
}
9+
10+
public Reference getValue(int i) {
11+
return (Reference) get(i);
12+
}
13+
14+
public void addValue(Reference v) {
15+
add(v);
16+
}
17+
18+
public void addValue(int i, Reference v) {
19+
add(i, v);
20+
}
21+
22+
public void setValue(int i, Reference v) {
23+
set(i, v);
24+
}
25+
26+
public void removeValue(int i) {
27+
remove(i);
28+
}
29+
} // ReferenceList

fUML-Java/generator/src/fuml/generator/main/generate.mtl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,11 @@
3232
[comment]
3333
* Uncomment the following line to generate the model as fUML-executable (i.e. generates bypasses PSCS execution environment)
3434
[/comment]
35-
[setIsFUMLExecutable()/]
35+
[comment] [setIsFUMLExecutable()/] [/comment]
3636
[comment]
3737
* Uncomment the following line to generate the model as PSCS-executable
3838
[/comment]
39-
[comment] [setIsPSCSExecutable()/] [/comment]
39+
[setIsPSCSExecutable()/]
4040

4141

4242
[comment Ensure that this is only done for the root package /]

fUML-Java/generator/src/fuml/generator/model/generateModelClassFile.mtl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -889,7 +889,7 @@ addToElementRepository("[anElement.getName()/]", [anElement.getFullNameSanitized
889889
[comment Apply stereotype <<Create>> (only stereotype required by PSCS) /]
890890
[comment hard coded by now; TODO: implement sophisticated stereotype application mechanism /]
891891
[if (not anOperation.getAppliedStereotype('StandardProfile::Create').oclIsUndefined())]
892-
[anOperation.getFullNameSanitized()/].applyStereotype(uml.standardprofile.StandardProfileModel.Instance().Stereotype_Create);
892+
[anOperation.getFullNameSanitized()/].applyStereotype(utils.standardprofile.StandardProfileModel.Instance().Stereotype_Create);
893893
[/if]
894894
[/let]
895895
[/template]
@@ -1010,6 +1010,7 @@ addToElementRepository("[anElement.getName()/]", [anElement.getFullNameSanitized
10101010

10111011
[template private generateElementInitialization(anElement : Element) ? (anElement.oclIsKindOf(Trigger)) post(trim())]
10121012
[let aTrigger : Trigger = anElement.oclAsType(Trigger)]
1013+
// [aTrigger.eClass().name + ' ' + aTrigger.getName()/]
10131014
[aTrigger.generateNamedElementInitialization()/]
10141015
[comment Property 'Trigger::event' /]
10151016
[if (not (aTrigger.event.oclIsUndefined()))]

fUML-Java/generator/src/fuml/generator/opaquebehaviorexecutions/generateOpaqueBehaviorExecutionClassFile.mtl

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,13 @@
1313
*/
1414
package [anOpaqueBehavior.getRootPackage().getNameSanitized()/];
1515

16-
[for (usingStatement : String |
17-
anOpaqueBehavior.getOpaqueBehaviorExecutionUsingsFromModel()
16+
[for (importStatement : String |
17+
anOpaqueBehavior.getOpaqueBehaviorExecutionImportsFromModel()
1818
->including('import fuml.semantics.commonbehavior.OpaqueBehaviorExecution;\r\n')
1919
->including('import fuml.semantics.commonbehavior.ParameterValueList;\r\n')
2020
->including('import fuml.semantics.values.Value;\r\n')
2121
->asOrderedSet())]
22-
[usingStatement/]
22+
[importStatement/]
2323
[/for]
2424

2525
/* [protected (': User-defined imports')]
@@ -56,7 +56,7 @@ public class [anOpaqueBehavior.getNameSanitized()/]Execution extends OpaqueBehav
5656
}
5757

5858
@Override
59-
protected Value new_()
59+
public Value new_()
6060
{
6161
return new [anOpaqueBehavior.getNameSanitized() + 'Execution'/]();
6262
}
@@ -80,7 +80,7 @@ public class [anOpaqueBehavior.getNameSanitized()/]Execution extends OpaqueBehav
8080
endif /]
8181
[query private isRootPackage(aPackage : Package) : Boolean = aPackage.nestingPackage = null /]
8282

83-
[query private getOpaqueBehaviorExecutionUsingsFromModel(anOpaqueBehavior : OpaqueBehavior) : Set(String) =
83+
[query private getOpaqueBehaviorExecutionImportsFromModel(anOpaqueBehavior : OpaqueBehavior) : Set(String) =
8484
if(anOpaqueBehavior.language->includes('Import') and anOpaqueBehavior._body->size() >= anOpaqueBehavior.language->size())
8585
then anOpaqueBehavior._body->at(anOpaqueBehavior.language->indexOf('Import')).tokenize('\n').tokenize('\r\n')->asSet()
8686
else Set(String){}

fUML-Java/pscs/.classpath

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<classpath>
3+
<classpathentry kind="src" path="src"/>
4+
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER">
5+
<attributes>
6+
<attribute name="module" value="true"/>
7+
</attributes>
8+
</classpathentry>
9+
<classpathentry combineaccessrules="false" kind="src" path="/fuml"/>
10+
<classpathentry combineaccessrules="false" kind="src" path="/uml"/>
11+
<classpathentry kind="output" path="bin"/>
12+
</classpath>

fUML-Java/pscs/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/bin/

fUML-Java/pscs/.project

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<projectDescription>
3+
<name>pscs</name>
4+
<comment></comment>
5+
<projects>
6+
</projects>
7+
<buildSpec>
8+
<buildCommand>
9+
<name>org.eclipse.jdt.core.javabuilder</name>
10+
<arguments>
11+
</arguments>
12+
</buildCommand>
13+
</buildSpec>
14+
<natures>
15+
<nature>org.eclipse.jdt.core.javanature</nature>
16+
</natures>
17+
</projectDescription>

0 commit comments

Comments
 (0)