Created
May 24, 2012 15:13
-
-
Save abelhegedus/2782145 to your computer and use it in GitHub Desktop.
Small examples for EMF-IncQuery part 2
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
| pattern ClassWithGivenNameAndHasAttribute(Cls : EClass) = { | |
| find EClassWithGivenName(Cls); | |
| find ClassAttributes(Cls,Attr); | |
| } |
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
| pattern ClassWithGivenNameAndNoAttribute(Cls : EClass) = { | |
| find EClassWithGivenName(Cls); | |
| neg find ClassAttributes(Cls,Attr); | |
| } |
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
| pattern ClassWithGivenNameAndNoAttribute(Cls : EClass) = { | |
| find EClassWithGivenName(Cls); | |
| EAttribute(Attr); | |
| neg find ClassAttributes(Cls,Attr); | |
| } |
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
| pattern TwoClassesAreTheSame(Cls : EClass, Cls2 : EClass) = { | |
| EClass.name(Cls,"MyClass"); | |
| EClass.eAttributes(Cls2,Attr); | |
| Cls == Cls2; | |
| } |
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
| pattern TwoClassesDifferent(Cls : EClass, Cls2 : EClass) = { | |
| EClass.name(Cls,"MyClass"); | |
| EClass.eAttributes(Cls2,Attr); | |
| Cls != Cls2; | |
| } |
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
| pattern TwoClassesMaybeTheSame(Cls : EClass, Cls2 : EClass) = { | |
| EClass.name(Cls,"MyClass"); | |
| EClass.eAttributes(Cls2,Attr); | |
| } |
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
| pattern TwoClassesMaybeTheSame(Cls : EClass, Cls2 : EClass) = { | |
| find EClassWithGivenName(Cls); | |
| find ClassAttributes(Cls2,Attr); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment