forked from eclipse-epsilon/epsilon
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'eclipse:main' into main
- Loading branch information
Showing
6 changed files
with
104 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<projectDescription> | ||
<name>org.eclipse.epsilon.examples.eol.ecore</name> | ||
<comment></comment> | ||
<projects> | ||
</projects> | ||
<buildSpec> | ||
</buildSpec> | ||
<natures> | ||
</natures> | ||
</projectDescription> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<project default="main"> | ||
<target name="main"> | ||
<!-- Load the psl.ecore EMF metamodel --> | ||
<epsilon.emf.loadModel name="M" modelfile="psl.ecore" metamodeluri="http://www.eclipse.org/emf/2002/Ecore" /> | ||
|
||
<!-- Run program.eol against it --> | ||
<epsilon.eol src="program.eol"> | ||
<model ref="M" /> | ||
</epsilon.eol> | ||
|
||
<!-- Dispose of the metamodel --> | ||
<epsilon.disposeModel model="M"/> | ||
</target> | ||
</project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
// Print the names of all classes in the metamodel | ||
for (c in EClass.all) { | ||
c.name.println(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<ecore:EPackage xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" name="psl" nsURI="psl" nsPrefix=""> | ||
<eClassifiers xsi:type="ecore:EClass" name="Project"> | ||
<eStructuralFeatures xsi:type="ecore:EAttribute" name="title" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/> | ||
<eStructuralFeatures xsi:type="ecore:EAttribute" name="description" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/> | ||
<eStructuralFeatures xsi:type="ecore:EReference" name="tasks" upperBound="-1" | ||
eType="#//Task" containment="true"/> | ||
<eStructuralFeatures xsi:type="ecore:EReference" name="people" upperBound="-1" | ||
eType="#//Person" containment="true"> | ||
<eAnnotations source="diagram"> | ||
<details key="direction" value="right"/> | ||
</eAnnotations> | ||
</eStructuralFeatures> | ||
</eClassifiers> | ||
<eClassifiers xsi:type="ecore:EClass" name="Task"> | ||
<eStructuralFeatures xsi:type="ecore:EAttribute" name="title" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/> | ||
<eStructuralFeatures xsi:type="ecore:EAttribute" name="start" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EInt"/> | ||
<eStructuralFeatures xsi:type="ecore:EAttribute" name="duration" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EInt"/> | ||
<eStructuralFeatures xsi:type="ecore:EReference" name="effort" upperBound="-1" | ||
eType="#//Effort" containment="true"> | ||
<eAnnotations source="diagram"> | ||
<details key="direction" value="right"/> | ||
</eAnnotations> | ||
</eStructuralFeatures> | ||
</eClassifiers> | ||
<eClassifiers xsi:type="ecore:EClass" name="Person"> | ||
<eStructuralFeatures xsi:type="ecore:EAttribute" name="name" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/> | ||
</eClassifiers> | ||
<eClassifiers xsi:type="ecore:EClass" name="Effort"> | ||
<eStructuralFeatures xsi:type="ecore:EReference" name="person" eType="#//Person"> | ||
<eAnnotations source="diagram"> | ||
<details key="direction" value="up"/> | ||
</eAnnotations> | ||
</eStructuralFeatures> | ||
<eStructuralFeatures xsi:type="ecore:EAttribute" name="percentage" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EInt" | ||
defaultValueLiteral="100"/> | ||
</eClassifiers> | ||
</ecore:EPackage> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
@namespace(uri="psl", prefix="") | ||
package psl; | ||
|
||
class Project { | ||
attr String title; | ||
attr String description; | ||
val Task[*] tasks; | ||
@diagram(direction="right") | ||
val Person[*] people; | ||
} | ||
|
||
class Task { | ||
attr String title; | ||
attr int start; | ||
attr int duration; | ||
@diagram(direction="right") | ||
val Effort[*] effort; | ||
} | ||
|
||
class Person { | ||
attr String name; | ||
} | ||
|
||
class Effort { | ||
@diagram(direction="up") | ||
ref Person person; | ||
attr int percentage = 100; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# How to run this example | ||
|
||
- Download and install [Epsilon's Eclipse development tools](https://eclipse.org/epsilon/download) | ||
- Import this project into Eclipse using the `File` -> `Import` -> `Existing Projects into Workspace` wizard | ||
- Right-click on `build.xml` in Eclipse's Project/Package Explorer view | ||
- Select `Run as` -> `Ant Build ...` | ||
- In the `JRE` tab of the dialog that pops up, select `Run in the same JRE as the workspace` | ||
- Click `Run` |