├── .gitattributes
├── .github
└── workflows
│ └── dotnetcore.yml
├── .gitignore
├── Ecore.sln
├── Ecore
├── Ecore.csproj
├── Ecore.nuspec
├── Ecore
│ ├── AbstractCollection.cs
│ ├── Adapter.cs
│ ├── AdapterImpl.cs
│ ├── Bag.cs
│ ├── BasicDiagnostic.cs
│ ├── BasicEObjectImpl.cs
│ ├── BasicNotifierImpl.cs
│ ├── Collection.cs
│ ├── Diagnostic.cs
│ ├── DiagnosticChain.cs
│ ├── DiagnosticImpl.cs
│ ├── Diagnostician.cs
│ ├── EAnnotation.cs
│ ├── EAnnotationBase.cs
│ ├── EAnnotationImpl.cs
│ ├── EAttribute.cs
│ ├── EAttributeBase.cs
│ ├── EAttributeImpl.cs
│ ├── EClass.cs
│ ├── EClassBase.cs
│ ├── EClassImpl.cs
│ ├── EClassifier.cs
│ ├── EClassifierBase.cs
│ ├── EClassifierImpl.cs
│ ├── EDataType.cs
│ ├── EDataTypeBase.cs
│ ├── EDataTypeImpl.cs
│ ├── EEnum.cs
│ ├── EEnumBase.cs
│ ├── EEnumImpl.cs
│ ├── EEnumLiteral.cs
│ ├── EEnumLiteralBase.cs
│ ├── EEnumLiteralImpl.cs
│ ├── EEnumerator.cs
│ ├── EFactory.cs
│ ├── EFactoryBase.cs
│ ├── EFactoryImpl.cs
│ ├── EGenericType.cs
│ ├── EGenericTypeBase.cs
│ ├── EGenericTypeImpl.cs
│ ├── EMap.cs
│ ├── EModelElement.cs
│ ├── EModelElementBase.cs
│ ├── EModelElementImpl.cs
│ ├── ENamedElement.cs
│ ├── ENamedElementBase.cs
│ ├── ENamedElementImpl.cs
│ ├── ENotificationImpl.cs
│ ├── EObject.cs
│ ├── EObjectBase.cs
│ ├── EObjectImpl.cs
│ ├── EObjectValidator.cs
│ ├── EOperation.cs
│ ├── EOperationBase.cs
│ ├── EOperationImpl.cs
│ ├── EPackage.cs
│ ├── EPackageBase.cs
│ ├── EPackageImpl.cs
│ ├── EParameter.cs
│ ├── EParameterBase.cs
│ ├── EParameterImpl.cs
│ ├── EReference.cs
│ ├── EReferenceBase.cs
│ ├── EReferenceImpl.cs
│ ├── EStringToStringMapEntry.cs
│ ├── EStringToStringMapEntryBase.cs
│ ├── EStringToStringMapEntryImpl.cs
│ ├── EStructuralFeature.cs
│ ├── EStructuralFeatureBase.cs
│ ├── EStructuralFeatureImpl.cs
│ ├── ETypeParameter.cs
│ ├── ETypeParameterBase.cs
│ ├── ETypeParameterImpl.cs
│ ├── ETypedElement.cs
│ ├── ETypedElementBase.cs
│ ├── ETypedElementImpl.cs
│ ├── EValidator.cs
│ ├── EcoreEList.cs
│ ├── EcoreEMap.cs
│ ├── EcoreFactory.cs
│ ├── EcoreFactoryImpl.cs
│ ├── EcorePackage.cs
│ ├── EcorePackageImpl.cs
│ ├── EcoreSwitch.cs
│ ├── EcoreUtil.cs
│ ├── EcoreValidator.cs
│ ├── InternalEObject.cs
│ ├── Map.cs
│ ├── Notification.cs
│ ├── NotificationChain.cs
│ ├── NotificationChainImpl.cs
│ ├── NotificationImpl.cs
│ ├── Notifier.cs
│ ├── NotifyingList.cs
│ ├── OclAny.cs
│ ├── OclInvalid.cs
│ ├── OclVoid.cs
│ ├── OrderedSet.cs
│ ├── Resource.cs
│ ├── ResourceLocator.cs
│ ├── Sequence.cs
│ ├── Serializer.cs
│ ├── Set.cs
│ ├── Switch.cs
│ ├── TreeIterator.cs
│ └── UnlimitedNatural.cs
└── Xmi
│ └── XmiResource.cs
├── EcoreTest
├── .gitignore
├── EReferenceIntegrityTest.cs
├── EcoreTest.csproj
├── Ocltestmodel
│ ├── MyClass.cs
│ ├── MyClassBase.cs
│ ├── MyClassImpl.cs
│ ├── OcltestmodelFactory.cs
│ ├── OcltestmodelFactoryImpl.cs
│ ├── OcltestmodelPackage.cs
│ ├── OcltestmodelPackageImpl.cs
│ ├── OcltestmodelSwitch.cs
│ └── index.html
├── OrderedSetTest.cs
├── Serialization
│ ├── MyClass.cs
│ ├── MyClassBase.cs
│ ├── MyClassImpl.cs
│ ├── OtherClass.cs
│ ├── OtherClassBase.cs
│ ├── OtherClassImpl.cs
│ ├── SerializationFactory.cs
│ ├── SerializationFactoryImpl.cs
│ ├── SerializationPackage.cs
│ ├── SerializationPackageImpl.cs
│ ├── SerializationSwitch.cs
│ ├── SerializationValidator.cs
│ ├── YetAnotherClass.cs
│ ├── YetAnotherClassBase.cs
│ ├── YetAnotherClassImpl.cs
│ ├── index.html
│ └── project.csproj
└── Testmodel
│ ├── A.cs
│ ├── ABase.cs
│ ├── AImpl.cs
│ ├── B.cs
│ ├── BBase.cs
│ ├── BImpl.cs
│ ├── C.cs
│ ├── CBase.cs
│ ├── CImpl.cs
│ ├── Source.cs
│ ├── SourceBase.cs
│ ├── SourceImpl.cs
│ ├── SubAbstractClass1.cs
│ ├── SubAbstractClass1Base.cs
│ ├── SubAbstractClass1Impl.cs
│ ├── SubAbstractClass2.cs
│ ├── SubAbstractClass2Base.cs
│ ├── SubAbstractClass2Impl.cs
│ ├── SubAbstractClass3.cs
│ ├── SubAbstractClass3Base.cs
│ ├── SubAbstractClass3Impl.cs
│ ├── SubAbstractClass4.cs
│ ├── SubAbstractClass4Base.cs
│ ├── SubAbstractClass4Impl.cs
│ ├── SubAbstractClass5.cs
│ ├── SubAbstractClass5Base.cs
│ ├── SubAbstractClass5Impl.cs
│ ├── SubAbstractClass6.cs
│ ├── SubAbstractClass6Base.cs
│ ├── SubAbstractClass6Impl.cs
│ ├── SubAbstractClass7.cs
│ ├── SubAbstractClass7Base.cs
│ ├── SubAbstractClass7Impl.cs
│ ├── SubClass1.cs
│ ├── SubClass1Base.cs
│ ├── SubClass1Impl.cs
│ ├── SubClass2.cs
│ ├── SubClass2Base.cs
│ ├── SubClass2Impl.cs
│ ├── SubClass3.cs
│ ├── SubClass3Base.cs
│ ├── SubClass3Impl.cs
│ ├── SubClass4.cs
│ ├── SubClass4Base.cs
│ ├── SubClass4Impl.cs
│ ├── SubClass5.cs
│ ├── SubClass5Base.cs
│ ├── SubClass5Impl.cs
│ ├── SubClass6.cs
│ ├── SubClass6Base.cs
│ ├── SubClass6Impl.cs
│ ├── SubClass7.cs
│ ├── SubClass7Base.cs
│ ├── SubClass7Impl.cs
│ ├── SubInterface1.cs
│ ├── SubInterface1Base.cs
│ ├── SubInterface1Impl.cs
│ ├── SubInterface2.cs
│ ├── SubInterface2Base.cs
│ ├── SubInterface2Impl.cs
│ ├── SubInterface3.cs
│ ├── SubInterface3Base.cs
│ ├── SubInterface3Impl.cs
│ ├── SubInterface4.cs
│ ├── SubInterface4Base.cs
│ ├── SubInterface4Impl.cs
│ ├── SubInterface5.cs
│ ├── SubInterface5Base.cs
│ ├── SubInterface5Impl.cs
│ ├── SubInterface6.cs
│ ├── SubInterface6Base.cs
│ ├── SubInterface6Impl.cs
│ ├── SubInterface7.cs
│ ├── SubInterface7Base.cs
│ ├── SubInterface7Impl.cs
│ ├── SuperAbstractClass.cs
│ ├── SuperAbstractClassBase.cs
│ ├── SuperAbstractClassImpl.cs
│ ├── SuperClass.cs
│ ├── SuperClassBase.cs
│ ├── SuperClassImpl.cs
│ ├── SuperInterface.cs
│ ├── SuperInterfaceBase.cs
│ ├── SuperInterfaceImpl.cs
│ ├── Target.cs
│ ├── TargetBase.cs
│ ├── TargetImpl.cs
│ ├── TestmodelFactory.cs
│ ├── TestmodelFactoryImpl.cs
│ ├── TestmodelPackage.cs
│ ├── TestmodelPackageImpl.cs
│ └── TestmodelSwitch.cs
├── LICENSE
└── README.md
/.gitattributes:
--------------------------------------------------------------------------------
1 | ###############################################################################
2 | # Set default behavior to automatically normalize line endings.
3 | ###############################################################################
4 | * text=auto
5 |
6 | ###############################################################################
7 | # Set default behavior for command prompt diff.
8 | #
9 | # This is need for earlier builds of msysgit that does not have it on by
10 | # default for csharp files.
11 | # Note: This is only used by command line
12 | ###############################################################################
13 | #*.cs diff=csharp
14 |
15 | ###############################################################################
16 | # Set the merge driver for project and solution files
17 | #
18 | # Merging from the command prompt will add diff markers to the files if there
19 | # are conflicts (Merging from VS is not affected by the settings below, in VS
20 | # the diff markers are never inserted). Diff markers may cause the following
21 | # file extensions to fail to load in VS. An alternative would be to treat
22 | # these files as binary and thus will always conflict and require user
23 | # intervention with every merge. To do so, just uncomment the entries below
24 | ###############################################################################
25 | #*.sln merge=binary
26 | #*.csproj merge=binary
27 | #*.vbproj merge=binary
28 | #*.vcxproj merge=binary
29 | #*.vcproj merge=binary
30 | #*.dbproj merge=binary
31 | #*.fsproj merge=binary
32 | #*.lsproj merge=binary
33 | #*.wixproj merge=binary
34 | #*.modelproj merge=binary
35 | #*.sqlproj merge=binary
36 | #*.wwaproj merge=binary
37 |
38 | ###############################################################################
39 | # behavior for image files
40 | #
41 | # image files are treated as binary by default.
42 | ###############################################################################
43 | #*.jpg binary
44 | #*.png binary
45 | #*.gif binary
46 |
47 | ###############################################################################
48 | # diff behavior for common document formats
49 | #
50 | # Convert binary document formats to text before diffing them. This feature
51 | # is only available from the command line. Turn it on by uncommenting the
52 | # entries below.
53 | ###############################################################################
54 | #*.doc diff=astextplain
55 | #*.DOC diff=astextplain
56 | #*.docx diff=astextplain
57 | #*.DOCX diff=astextplain
58 | #*.dot diff=astextplain
59 | #*.DOT diff=astextplain
60 | #*.pdf diff=astextplain
61 | #*.PDF diff=astextplain
62 | #*.rtf diff=astextplain
63 | #*.RTF diff=astextplain
64 |
--------------------------------------------------------------------------------
/.github/workflows/dotnetcore.yml:
--------------------------------------------------------------------------------
1 | name: Build
2 | on:
3 | push:
4 | branches:
5 | - master
6 | pull_request:
7 | types: [opened, synchronize, reopened]
8 | jobs:
9 | build:
10 | name: Build
11 | runs-on: windows-latest
12 | steps:
13 | - name: Set up JDK 11
14 | uses: actions/setup-java@v1
15 | with:
16 | java-version: 1.11
17 | - uses: actions/checkout@v2
18 | with:
19 | fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
20 | - name: Cache SonarCloud packages
21 | uses: actions/cache@v1
22 | with:
23 | path: ~\sonar\cache
24 | key: ${{ runner.os }}-sonar
25 | restore-keys: ${{ runner.os }}-sonar
26 | - name: Cache SonarCloud scanner
27 | id: cache-sonar-scanner
28 | uses: actions/cache@v1
29 | with:
30 | path: .\.sonar\scanner
31 | key: ${{ runner.os }}-sonar-scanner
32 | restore-keys: ${{ runner.os }}-sonar-scanner
33 | - name: Install SonarCloud scanner
34 | if: steps.cache-sonar-scanner.outputs.cache-hit != 'true'
35 | shell: powershell
36 | run: |
37 | New-Item -Path .\.sonar\scanner -ItemType Directory
38 | dotnet tool update dotnet-sonarscanner --tool-path .\.sonar\scanner
39 | - name: Build and analyze
40 | env:
41 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
42 | SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
43 | shell: powershell
44 | run: |
45 | .\.sonar\scanner\dotnet-sonarscanner begin /k:"crossecore_ecore-csharp" /o:"crossecore" /d:sonar.login="${{ secrets.SONAR_TOKEN }}" /d:sonar.host.url="https://sonarcloud.io"
46 | dotnet restore
47 | dotnet build
48 | dotnet test
49 | .\.sonar\scanner\dotnet-sonarscanner end /d:sonar.login="${{ secrets.SONAR_TOKEN }}"
--------------------------------------------------------------------------------
/Ecore.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio Version 16
4 | VisualStudioVersion = 16.0.29020.237
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Ecore", "Ecore\Ecore.csproj", "{CBC71227-88CF-4220-859B-6F75B55C1C6B}"
7 | EndProject
8 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EcoreTest", "EcoreTest\EcoreTest.csproj", "{9F2EA3AE-893D-45A2-814B-41EB9DD8C22D}"
9 | EndProject
10 | Global
11 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
12 | Debug|Any CPU = Debug|Any CPU
13 | Release|Any CPU = Release|Any CPU
14 | EndGlobalSection
15 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
16 | {CBC71227-88CF-4220-859B-6F75B55C1C6B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
17 | {CBC71227-88CF-4220-859B-6F75B55C1C6B}.Debug|Any CPU.Build.0 = Debug|Any CPU
18 | {CBC71227-88CF-4220-859B-6F75B55C1C6B}.Release|Any CPU.ActiveCfg = Release|Any CPU
19 | {CBC71227-88CF-4220-859B-6F75B55C1C6B}.Release|Any CPU.Build.0 = Release|Any CPU
20 | {9F2EA3AE-893D-45A2-814B-41EB9DD8C22D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
21 | {9F2EA3AE-893D-45A2-814B-41EB9DD8C22D}.Debug|Any CPU.Build.0 = Debug|Any CPU
22 | {9F2EA3AE-893D-45A2-814B-41EB9DD8C22D}.Release|Any CPU.ActiveCfg = Release|Any CPU
23 | {9F2EA3AE-893D-45A2-814B-41EB9DD8C22D}.Release|Any CPU.Build.0 = Release|Any CPU
24 | EndGlobalSection
25 | GlobalSection(SolutionProperties) = preSolution
26 | HideSolutionNode = FALSE
27 | EndGlobalSection
28 | GlobalSection(ExtensibilityGlobals) = postSolution
29 | SolutionGuid = {6DCA42B4-986F-44C6-A2AD-5850C8C15908}
30 | EndGlobalSection
31 | EndGlobal
32 |
--------------------------------------------------------------------------------
/Ecore/Ecore.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | netcoreapp3.1
5 | Simon Schwichtenberg
6 | CrossEcore
7 | Com.Crossecore.Ecore
8 | CrossEcore
9 | https://github.com/crossecore/ecore-csharp
10 | Ecore and OCL runtime API for C#
11 | http://www.crossecore.org
12 | true
13 | 0.1.1
14 | EPL-2.0
15 | true
16 | Library
17 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/Ecore/Ecore.nuspec:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Com.CrossEcore.Ecore
5 | 0.1.1
6 | Simon Schwichtenberg
7 | Simon Schwichtenberg
8 | true
9 | EPL-2.0
10 | http://www.crossecore.com
11 | Ecore and OCL C# runtime API
12 | Copyright 2020
13 |
14 |
--------------------------------------------------------------------------------
/Ecore/Ecore/Adapter.cs:
--------------------------------------------------------------------------------
1 | /* CrossEcore is a cross-platform modeling framework that generates C#, TypeScript,
2 | * JavaScript, Swift code from Ecore models with embedded OCL (http://www.crossecore.org/).
3 | * The original Eclipse Modeling Framework is available at https://www.eclipse.org/modeling/emf/.
4 | *
5 | * contributor: Simon Schwichtenberg
6 | */
7 |
8 | using System;
9 |
10 | namespace Ecore
11 | {
12 | public interface Adapter
13 | {
14 | void notifyChanged(Notification notification);
15 | //Notifier getTarget();
16 | //void setTarget(Notifier newTarget);
17 | //bool isAdapterForType(object type);
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/Ecore/Ecore/AdapterImpl.cs:
--------------------------------------------------------------------------------
1 | /* CrossEcore is a cross-platform modeling framework that generates C#, TypeScript,
2 | * JavaScript, Swift code from Ecore models with embedded OCL (http://www.crossecore.org/).
3 | * The original Eclipse Modeling Framework is available at https://www.eclipse.org/modeling/emf/.
4 | *
5 | * contributor: Simon Schwichtenberg
6 | */
7 |
8 | using System;
9 | using System.Collections.Generic;
10 | using System.Linq;
11 | using System.Text;
12 | using System.Threading.Tasks;
13 |
14 | namespace Ecore
15 | {
16 |
17 | public class AdapterImpl : Adapter
18 | {
19 |
20 | protected Notifier target = null;
21 |
22 | public AdapterImpl()
23 | {
24 |
25 | }
26 |
27 | public bool isAdapterForType(Object type)
28 | {
29 | return false;
30 | }
31 |
32 |
33 | public virtual void notifyChanged(Notification msg)
34 | {
35 | // Do nothing.
36 | }
37 |
38 |
39 | public Notifier getTarget()
40 | {
41 | return target;
42 | }
43 |
44 |
45 | public void setTarget(Notifier newTarget)
46 | {
47 | target = newTarget;
48 | }
49 |
50 | public void unsetTarget(Notifier oldTarget)
51 | {
52 | if (target == oldTarget)
53 | {
54 | setTarget(null);
55 | }
56 | }
57 | }
58 | }
59 |
--------------------------------------------------------------------------------
/Ecore/Ecore/BasicDiagnostic.cs:
--------------------------------------------------------------------------------
1 | /* CrossEcore is a cross-platform modeling framework that generates C#, TypeScript,
2 | * JavaScript, Swift code from Ecore models with embedded OCL (http://www.crossecore.org/).
3 | * The original Eclipse Modeling Framework is available at https://www.eclipse.org/modeling/emf/.
4 | *
5 | * contributor: Simon Schwichtenberg
6 | */
7 |
8 | using System;
9 | using System.Collections.Generic;
10 | using System.Linq;
11 | using System.Text;
12 | using System.Threading.Tasks;
13 |
14 | namespace Ecore
15 | {
16 | public class BasicDiagnostic:Diagnostic, DiagnosticChain
17 | {
18 |
19 | public const int OK = 0x0;
20 |
21 | public const int INFO = 0x1;
22 |
23 | public const int WARNING = 0x2;
24 |
25 | public const int ERROR = 0x4;
26 |
27 | public const int CANCEL = 0x8;
28 |
29 | protected int severity;
30 | protected string message;
31 | protected List children;
32 | protected List