-
Notifications
You must be signed in to change notification settings - Fork 4
Add abstract classes and inheritance to NeoJoin #174
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
larsk21
wants to merge
17
commits into
main
Choose a base branch
from
feature/inheritance
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
bdcf613
add syntax for abstract classes, extensions, and abstract features
larsk21 cb1db97
add support for super classes and overwriting features to AQR and met…
larsk21 c9cdded
add scope provider for super classes
larsk21 ed9009c
fix detection of overwritten features and validate inheritance
larsk21 e9309ec
Merge branch 'main' into feature/inheritance
larsk21 48e7c90
small fixes
larsk21 d4aa15a
add meta-level support for abstract target classes
larsk21 d85db10
Merge branch 'main' into feature/inheritance
larsk21 9f0e433
fix feature assignment check
larsk21 c2c380b
terminology
larsk21 7c00535
small fixes
larsk21 24d251f
add basic CLI test for abstract classes and inheritance
larsk21 799ce7d
Merge branch 'main' into feature/inheritance
larsk21 346e3e6
enable transformation of overriding features
larsk21 34880b9
do not generate root references for abstract classes
larsk21 0b16a76
fix transformation of references where instance of sub classes are re…
larsk21 df2025b
fix checks for overriding features
larsk21 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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,29 @@ | ||
| <?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="pizza" nsURI="http://example.org/pizza2" nsPrefix="pizza"> | ||
| <eClassifiers xsi:type="ecore:EEnum" name="FoodType"> | ||
| <eLiterals name="FOOD"/> | ||
| <eLiterals name="DRINK" value="1"/> | ||
| </eClassifiers> | ||
| <eClassifiers xsi:type="ecore:EClass" name="Food" eSuperTypes="#//Item"> | ||
| <eStructuralFeatures xsi:type="ecore:EAttribute" name="price" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EFloat"/> | ||
| <eStructuralFeatures xsi:type="ecore:EAttribute" name="type" eType="#//FoodType"/> | ||
| </eClassifiers> | ||
| <eClassifiers xsi:type="ecore:EClass" name="Item"> | ||
| <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="Root"> | ||
| <eStructuralFeatures xsi:type="ecore:EReference" name="allFoods" ordered="false" | ||
| upperBound="-1" eType="#//Food" containment="true"/> | ||
| <eStructuralFeatures xsi:type="ecore:EReference" name="allItems" ordered="false" | ||
| upperBound="-1" eType="#//Item" containment="true"/> | ||
| <eStructuralFeatures xsi:type="ecore:EReference" name="allPizzerias" ordered="false" | ||
| upperBound="-1" eType="#//Pizzeria" containment="true"/> | ||
| </eClassifiers> | ||
| <eClassifiers xsi:type="ecore:EClass" name="Restaurant" abstract="true"> | ||
| <eStructuralFeatures xsi:type="ecore:EAttribute" name="name" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/> | ||
| <eStructuralFeatures xsi:type="ecore:EReference" name="sells" upperBound="-1" | ||
| eType="#//Item"/> | ||
| </eClassifiers> | ||
| <eClassifiers xsi:type="ecore:EClass" name="Pizzeria" eSuperTypes="#//Restaurant"/> | ||
| </ecore:EPackage> |
This file contains hidden or 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,21 @@ | ||
| export pizza to "http://example.org/pizza2" | ||
|
|
||
| import "http://example.org/restaurant" | ||
|
|
||
| create abstract Restaurant { | ||
| name: EString | ||
| sells: Item [*] | ||
| } | ||
|
|
||
| create Item { | ||
| name := "<default>" | ||
| } | ||
| from Food | ||
| create extends Item | ||
|
|
||
| from Restaurant | ||
| where name.startsWith("Pizzeria") | ||
| create Pizzeria extends Restaurant { | ||
| name := name | ||
| sells := sells | ||
| } |
This file contains hidden or 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,29 @@ | ||
| <?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="pizza" nsURI="http://example.org/pizza2" nsPrefix="pizza"> | ||
| <eClassifiers xsi:type="ecore:EEnum" name="FoodType"> | ||
| <eLiterals name="FOOD"/> | ||
| <eLiterals name="DRINK" value="1"/> | ||
| </eClassifiers> | ||
| <eClassifiers xsi:type="ecore:EClass" name="Food" eSuperTypes="#//Item"> | ||
| <eStructuralFeatures xsi:type="ecore:EAttribute" name="price" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EFloat"/> | ||
| <eStructuralFeatures xsi:type="ecore:EAttribute" name="type" eType="#//FoodType"/> | ||
| </eClassifiers> | ||
| <eClassifiers xsi:type="ecore:EClass" name="Item"> | ||
| <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="Root"> | ||
| <eStructuralFeatures xsi:type="ecore:EReference" name="allFoods" ordered="false" | ||
| upperBound="-1" eType="#//Food" containment="true"/> | ||
| <eStructuralFeatures xsi:type="ecore:EReference" name="allItems" ordered="false" | ||
| upperBound="-1" eType="#//Item" containment="true"/> | ||
| <eStructuralFeatures xsi:type="ecore:EReference" name="allPizzerias" ordered="false" | ||
| upperBound="-1" eType="#//Pizzeria" containment="true"/> | ||
| </eClassifiers> | ||
| <eClassifiers xsi:type="ecore:EClass" name="Restaurant" abstract="true"> | ||
| <eStructuralFeatures xsi:type="ecore:EAttribute" name="name" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/> | ||
| <eStructuralFeatures xsi:type="ecore:EReference" name="sells" upperBound="-1" | ||
| eType="#//Item"/> | ||
| </eClassifiers> | ||
| <eClassifiers xsi:type="ecore:EClass" name="Pizzeria" eSuperTypes="#//Restaurant"/> | ||
| </ecore:EPackage> |
This file contains hidden or 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 @@ | ||
| <?xml version="1.0" encoding="ASCII"?> | ||
| <pizza:Root xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:pizza="http://example.org/pizza2"> | ||
| <allItems name="<default>"/> | ||
| <allPizzerias name="Pizzeria Toni" sells="//@allFoods.0 //@allFoods.1"/> | ||
| <allFoods name="Pizza Margherita" price="7.0"/> | ||
| <allFoods name="Fanta" price="5.0" type="DRINK"/> | ||
| <allFoods name="Maultaschen" price="8.0"/> | ||
| </pizza:Root> |
This file contains hidden or 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
This file contains hidden or 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
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, actually not, because that part is not implemented yet :p