[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[news.eclipse.technology.gmt] Re: MOFScript: strange imports management in compiler

Regarding 1), this is a shortcoming of the compile-time model checking, but should apply to any rule or function called, not just ones existing in other transformation rules (that are not imported). Some more active checking would probably improve things....

Regarding 2), there is a bug in the importing facility, which takes the directory path of the "root" file that is parsed as the relative root also for indirect imports, not correct of course. Yet another issue for the backlog.

/ Jon

Yannick wrote:

Hi,

I noticed that MOFScript (1.1.5) has a strange behaviour for imports
management:

1)

At compilation, MOFScript doesn't detect bad rules' calls if that rule
exists in another transformation file (and transformation file isn't
imported)

For example, that is in main1.m2t :

texttransformation main1 (in uml:"http://www.eclipse.org/uml2/2.0.0/UML";) {

  uml.Model::main(){
	self.main1()

  }
  uml.Model::main1(){
	self.main2()
  }
}


And main2.m2t is in same folder or sub-folder of main1.m2t:

texttransformation main2 (in uml:"http://www.eclipse.org/uml2/2.0.0/UML";) {

  uml.Model::main(){
    stdout.println ("")
  }
  uml.Model::main2(){
  }
}

In file main1.m2t, I don't have a compilation error but I get a runtime
error during execution as expected.


2)

Cascading imports doesn't compile, I have to make all imports in the
main transformation file.

Example with 3 files:
main1.m2t -> imports main2.m2t (in a sub-folder)
main2.m2t -> imports main3.m2t (in sub-folder of main2.m2t)
main3.m2t -> no imports needed

In this case, I get compilation errors. But if I write all imports in
main1.m2t, it compiles.



Are those normal behaviour for MOFScript compiler?