Guest User

Untitled

a guest
Dec 14th, 2018
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.78 KB | None | 0 0
  1. Domainmodel:
  2. elements+=Element*;
  3.  
  4. Element:
  5. Aggregate | ValueObject;
  6.  
  7. Aggregate:
  8. 'aggregate' name=ValidID ('extends' superType=JvmTypeReference)? '{'
  9. properties+=Property*
  10. '}';
  11.  
  12. ValueObject:
  13. 'valueObject' name=ValidID ('extends' superType=JvmTypeReference)? '{'
  14. properties+=Property*
  15. '}';
  16.  
  17. Property:
  18. name=ValidID ':' type=JvmTypeReference;
  19.  
  20. valueObject Address{
  21. }
  22. aggregate Person{
  23. p : Address
  24. }
  25.  
  26. @Check
  27. def checkAggregateReference(Aggregate aggregate) {
  28. var properties = aggregate.properties
  29.  
  30. for(Property f : properties){
  31. if(f is aggregate)
  32. error('An aggregate is not allowed to reference another aggregate'
  33. ,MdDslPackage.Literals.AGGREGATE
  34. ,f.eContainingFeature)
  35. }}
  36. }
Add Comment
Please, Sign In to add comment