Skip to content

Commit

Permalink
Continued with ECore example
Browse files Browse the repository at this point in the history
  • Loading branch information
PaulKlint committed Aug 13, 2009
1 parent 3eb773b commit 2e38bcb
Show file tree
Hide file tree
Showing 2 changed files with 112 additions and 16 deletions.
Binary file modified doc/ProgressImplementation.ods
Binary file not shown.
128 changes: 112 additions & 16 deletions src/experiments/ModelTransformations/ECore.rsc
Original file line number Diff line number Diff line change
@@ -1,18 +1,114 @@
module ModelTransformations::ECore

// Attempt to describe ECore as a Rascal datatype

data EClass = eClass(str name,
list[EClass] eSuperTypes,
list[EAttribute] eAttributes, //0..*
list[EReferences] eReferences); //0..*

data EAttribute = eAttribute(str name, EDataType eAttributeType);

data EDataType = eDataType(str name);

data EReference = eReference(str name,
bool containment,
int lowerbound,
int upperbound,
list[EReference] eOpposite); // 0..1
// Definition of ECore.
// See http://download.eclipse.org/modeling/emf/emf/javadoc/2.5.0/org/eclipse/emf/ecore/package-summary.html

data EModelElement =
eModelElement(list[EAnnotation] eAnnotations);

data EAnnotation =
eAnnotation(EModelElement inh,
str source,
EStringToStringMapEntry details,
list[EObject] contents,
list[EObject], references
);

data ENamedElement =
eNamedElement(EModelElement inh,
str name);

data EFactory =
eFactory(EModelElement inh,
EPackage ePackage);

data ETypedElement =
eTypedElement(ENamedElement inh,
bool ordered, // =true
bool unique, // = true
int lowerBound,
int upperBound, // =1
bool many,
bool required,
list[EClassifier] eType);

data EClassifier =
eClassifier(ENamedElement inh,
str instanceClassName,
EJavaClass instanceClass,
EJavaObject defaultValue,
list[EPackage] eClassifiers);

data EPackage =
ePackage(ENamedElement inh,
str nsURI,
str nsPrefix,
list[EPackage] eSubpackages;
EFactory eFactoryInstance);

data EOperation =
eOperation(ETypedElement inh,
list[EParameter] eParameters);

data EParameter =
eParameter(ETypedElement inh);

data EClass =
eClass(EClassifier inh,
bool abstract,
bool interface,
list[EOperation] eAllOperations,
list[EStructuralFeature] eAllStructuralFeatures,
list[EReference] eAllContainments,
list[EReference] eAllReferences,
list[EReference] eReferences,
list[EAttribute] eAllAttributes,
list[EAttribute] eAttributes,
list[EAttribute] eIDAttribute,
list[EClass] eAllSuperTypes,
list[EClass] eSuperTypes);

data EDataType =
eDataType(EClassifier inh,
bool serializable); // = true

data ETypedElement =
eTypedElement(str name, // from ENamedElement
EClassifier eType);

data EStructuralFeature =
eStructuralFeature(ETypedElement inh,
bool changeable, // = true
bool volatile,
bool transient,
str defaultValueLiteral,
EJavaObject defautValue,
bool unsettable,
bool derived);

data EReference =
eReference(EStructuralFeature inh,
bool containment,
bool container,
bool resolveProxies, = true
EClass eReferenceType,
list[EReference] eOpposite); // 0..1

data EAttribute =
eAttribute(EStructuralFeature inh,
bool iD,
EDataType eAttributeType);

data EEnumLiteral =
eEnumLiteral(ENamedElement inh,
int value,
EEnumerator instance,
list[EEnum] eLiterals);

data EEnum =
eEnum(EDataType inh);

data EObject =
eObject();

data EAnnotation

0 comments on commit 2e38bcb

Please sign in to comment.