-
Notifications
You must be signed in to change notification settings - Fork 77
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
112 additions
and
16 deletions.
There are no files selected for viewing
Binary file not shown.
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 |
---|---|---|
@@ -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 |