Skip to content

Commit

Permalink
Merge branch 'eclipse:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
pkourouklidis authored Feb 6, 2024
2 parents 9f47de2 + 67d3443 commit 803954e
Show file tree
Hide file tree
Showing 6 changed files with 104 additions and 0 deletions.
11 changes: 11 additions & 0 deletions examples/org.eclipse.epsilon.examples.eol.ecore/.project
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>
14 changes: 14 additions & 0 deletions examples/org.eclipse.epsilon.examples.eol.ecore/build.xml
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>
4 changes: 4 additions & 0 deletions examples/org.eclipse.epsilon.examples.eol.ecore/program.eol
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();
}
39 changes: 39 additions & 0 deletions examples/org.eclipse.epsilon.examples.eol.ecore/psl.ecore
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>
28 changes: 28 additions & 0 deletions examples/org.eclipse.epsilon.examples.eol.ecore/psl.emf
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;
}
8 changes: 8 additions & 0 deletions examples/org.eclipse.epsilon.examples.eol.ecore/readme.md
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`

0 comments on commit 803954e

Please sign in to comment.