Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMT (Generative Modeling Technologies) » [Epsilon] Problem with ECL
[Epsilon] Problem with ECL [message #617618] Tue, 13 May 2008 18:17
Eclipse UserFriend
Originally posted by: ste_barr.cs.concordia.ca

Hello,

I'm trying to use ECL to help with some model merging. Unfortunately I'm
stuck.

My left model consits of a single class A, and the right a single class B.
I'm using the follow code (class.ecl) to compare them and print out the
match trace:


rule ClassA
match l : Left!Class with r : Right!Class {
compare : l.name = 'A' }

rule ClassB
match l : Left!Class with r : Right!Class {
compare : l.name = 'B' }

post {
-- Print name of matching elements and of the rule that matched them.
for (m in matchTrace.matches.select(m|m.isMatching)) {
(m.left.name + ' <' + m.getRule().name + '> ' +
m.right.name).println();
}
}


I think that the four element pairings should cause each rule to fire
once, so the output is a surprise to me:


A <ClassA> A
A <ClassA> B


Where are the B to A, B to B pairings? Why did rule ClassA match A with B?
And why does the second rule never fire?

I can't help put think that I'm missing something really basic here, but I
have spent a bit of time trying to unravel this. Thanks for taking a look.

--Steve

P.S. I couldn't get "m.rules.first().name" as given in the Complete OO to
DB comparison to work, which is why I'm using "m.getRule().name" Could
this be a source of trouble?
Previous Topic:[Epsilon] NoSuchMethodError running EOL from Java
Next Topic:[Epsilon] Problem with ECL
Goto Forum:
  


Current Time: Sun Nov 23 22:44:46 GMT 2014

Powered by FUDForum. Page generated in 0.01571 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software