|
|
|
Re: [TCS] Examples that convert .tcs file to model [message #375981 is a reply to message #375973] |
Fri, 23 February 2007 09:14   |
Eclipse User |
|
|
|
Hi Paul,
Paul Gribben a écrit :
> Thanks for this sample Freddy, it works fine.
>
> I've extended my project copy by defining a metamodel for the
> AddressBook by handcrafting an AddressBook.km3 (reverse-engineered from
> the AddressBook.tcs, is there a more clever way to produce the
> metamodel?). I've then successfully extracted a model file
You could define your metamodel directly in KM3 (which is a Domain
Specific Language or DSL for defining metamodels) and then automatically
transform it into other formats such as Ecore for example.
> (AddressBook1.ecore) to a text file (AddressBook1.out) using the ant
> task am3.saveModel (with extractor embedded element).
>
> I then tried to transform the text file back to a model file using the
> am3.loadModel with injector approach, but without success as follows:
>
> <target name="text2model" depends="loadModels">
> <am3.loadModel modelHandler="EMF" name="M" metamodel="AddressBook.tcs"
> path="${path}output/AddressBook1.out">
> <injector name="ebnf">
> <param name="name" value="TCS"/>
> <classpath>
> <pathelement location="${path}TCS/TCS-importer.jar" />
> </classpath>
> </injector>
> </am3.loadModel>
I think the error comes from the value of the "metamodel" parameter of
the am3.loadModel task. For instance, it may be metamodel="AddressBook"
if you already have loaded the AddressBook metamodel like this:
<am3.loadModel modelHandler="EMF" name="AddressBook" metamodel="MOF"
path="AddressBook.ecore" />
Regards,
Hugo
>
> <am3.saveModel model="M"
> path="${path}output/GeneratedAddressBook1.ecore"/>
> </target>
>
> .. where metamodel AddressBook.tcs is defined to be the
> AddressBook.tcs.ecore file.
>
> When I execute this I get:
> text2model:
> [am3.loadModel] Loading of model M
> [am3.loadModel] no type named 'ConcreteSyntax' in metamodel
> 'AddressBook.tcs'
> [am3.loadModel] java.lang.NullPointerException
> [am3.loadModel] at
> org.atl.engine.repositories.emf4atl.ASMEMFModel.newModelElem ent(ASMEMFModel.java:206)
>
> [am3.loadModel] at
> org.atl.engine.vm.nativelib.ASMModel.newModelElement(ASMMode l.java:74)
> [am3.loadModel] at
> org.atl.engine.vm.nativelib.ASMModel.newModelElement(ASMMode l.java:62)
> (stack continues...)
>
> I've examined the AddressBook.tcs.ecore and it does contain the
> ConcreteSyntax type, so I'm a bit confused.
>
> Again, any help would be greatly appreciated.
>
> Thanks
> Paul
>
--
--------------------------------------------------------
Hugo Bruneliere - R&D Engineer
ATLAS Group (INRIA & LINA) - University of Nantes
2, rue de la Houssiniere
44322 Nantes Cedex 3 - France
office +33 2 51 12 58 10 /\ cell.+33 6 07 42 45 30
EMail: Hugo.Bruneliere@univ-nantes.fr
http://www.sciences.univ-nantes.fr/lina/atl/
--------------------------------------------------------
|
|
|
|
Re: [TCS] Examples that convert .tcs file to model [message #375991 is a reply to message #375973] |
Mon, 26 February 2007 17:11  |
Eclipse User |
|
|
|
Hi Paul,
Paul Gribben a écrit :
> Thanks for this sample Freddy, it works fine.
>
> I've extended my project copy by defining a metamodel for the
> AddressBook by handcrafting an AddressBook.km3 (reverse-engineered from
> the AddressBook.tcs, is there a more clever way to produce the
> metamodel?).
The normal process is to create first your metamodel ;-)
> I've then successfully extracted a model file
> (AddressBook1.ecore) to a text file (AddressBook1.out) using the ant
> task am3.saveModel (with extractor embedded element).
>
> I then tried to transform the text file back to a model file using the
> am3.loadModel with injector approach, but without success as follows:
>
> <target name="text2model" depends="loadModels">
> <am3.loadModel modelHandler="EMF" name="M" metamodel="AddressBook.tcs"
> path="${path}output/AddressBook1.out">
> <injector name="ebnf">
> <param name="name" value="TCS"/>
> <classpath>
> <pathelement location="${path}TCS/TCS-importer.jar" />
> </classpath>
> </injector>
> </am3.loadModel>
>
> <am3.saveModel model="M"
> path="${path}output/GeneratedAddressBook1.ecore"/>
> </target>
>
> .. where metamodel AddressBook.tcs is defined to be the
> AddressBook.tcs.ecore file.
>
In this case (text to model), you will need to generate and to use a
"specific" AddressBook injector (i.e. AddressBook-importer.jar).
I have created a complete TCS use case for AddressBook available here:
http://www.eclipse.org/gmt/am3/tcs/download/TCSSample.zip
And I have also started a tutorial:
http://wiki.eclipse.org/index.php/TCS/TCS_Toolkit_Tutorial
For the moment, this wiki page is only a stub. But I hope this can help
you :-)
Regards,
Freddy.
> When I execute this I get:
> text2model:
> [am3.loadModel] Loading of model M
> [am3.loadModel] no type named 'ConcreteSyntax' in metamodel
> 'AddressBook.tcs'
> [am3.loadModel] java.lang.NullPointerException
> [am3.loadModel] at
> org.atl.engine.repositories.emf4atl.ASMEMFModel.newModelElem ent(ASMEMFModel.java:206)
>
> [am3.loadModel] at
> org.atl.engine.vm.nativelib.ASMModel.newModelElement(ASMMode l.java:74)
> [am3.loadModel] at
> org.atl.engine.vm.nativelib.ASMModel.newModelElement(ASMMode l.java:62)
> (stack continues...)
>
> I've examined the AddressBook.tcs.ecore and it does contain the
> ConcreteSyntax type, so I'm a bit confused.
>
> Again, any help would be greatly appreciated.
>
> Thanks
> Paul
>
|
|
|
|
Re: [TCS] Examples that convert .tcs file to model [message #571690 is a reply to message #375967] |
Fri, 23 February 2007 05:05  |
Eclipse User |
|
|
|
Thanks for this sample Freddy, it works fine.
I've extended my project copy by defining a metamodel for the AddressBook
by handcrafting an AddressBook.km3 (reverse-engineered from the
AddressBook.tcs, is there a more clever way to produce the metamodel?).
I've then successfully extracted a model file (AddressBook1.ecore) to a
text file (AddressBook1.out) using the ant task am3.saveModel (with
extractor embedded element).
I then tried to transform the text file back to a model file using the
am3.loadModel with injector approach, but without success as follows:
<target name="text2model" depends="loadModels">
<am3.loadModel modelHandler="EMF" name="M" metamodel="AddressBook.tcs"
path="${path}output/AddressBook1.out">
<injector name="ebnf">
<param name="name" value="TCS"/>
<classpath>
<pathelement location="${path}TCS/TCS-importer.jar" />
</classpath>
</injector>
</am3.loadModel>
<am3.saveModel model="M"
path="${path}output/GeneratedAddressBook1.ecore"/>
</target>
... where metamodel AddressBook.tcs is defined to be the
AddressBook.tcs.ecore file.
When I execute this I get:
text2model:
[am3.loadModel] Loading of model M
[am3.loadModel] no type named 'ConcreteSyntax' in metamodel
'AddressBook.tcs'
[am3.loadModel] java.lang.NullPointerException
[am3.loadModel] at
org.atl.engine.repositories.emf4atl.ASMEMFModel.newModelElem ent(ASMEMFModel.java:206)
[am3.loadModel] at
org.atl.engine.vm.nativelib.ASMModel.newModelElement(ASMMode l.java:74)
[am3.loadModel] at
org.atl.engine.vm.nativelib.ASMModel.newModelElement(ASMMode l.java:62)
(stack continues...)
I've examined the AddressBook.tcs.ecore and it does contain the
ConcreteSyntax type, so I'm a bit confused.
Again, any help would be greatly appreciated.
Thanks
Paul
|
|
|
Re: [TCS] Examples that convert .tcs file to model [message #571777 is a reply to message #375973] |
Fri, 23 February 2007 09:14  |
Eclipse User |
|
|
|
Hi Paul,
Paul Gribben a écrit :
> Thanks for this sample Freddy, it works fine.
>
> I've extended my project copy by defining a metamodel for the
> AddressBook by handcrafting an AddressBook.km3 (reverse-engineered from
> the AddressBook.tcs, is there a more clever way to produce the
> metamodel?). I've then successfully extracted a model file
You could define your metamodel directly in KM3 (which is a Domain
Specific Language or DSL for defining metamodels) and then automatically
transform it into other formats such as Ecore for example.
> (AddressBook1.ecore) to a text file (AddressBook1.out) using the ant
> task am3.saveModel (with extractor embedded element).
>
> I then tried to transform the text file back to a model file using the
> am3.loadModel with injector approach, but without success as follows:
>
> <target name="text2model" depends="loadModels">
> <am3.loadModel modelHandler="EMF" name="M" metamodel="AddressBook.tcs"
> path="${path}output/AddressBook1.out">
> <injector name="ebnf">
> <param name="name" value="TCS"/>
> <classpath>
> <pathelement location="${path}TCS/TCS-importer.jar" />
> </classpath>
> </injector>
> </am3.loadModel>
I think the error comes from the value of the "metamodel" parameter of
the am3.loadModel task. For instance, it may be metamodel="AddressBook"
if you already have loaded the AddressBook metamodel like this:
<am3.loadModel modelHandler="EMF" name="AddressBook" metamodel="MOF"
path="AddressBook.ecore" />
Regards,
Hugo
>
> <am3.saveModel model="M"
> path="${path}output/GeneratedAddressBook1.ecore"/>
> </target>
>
> .. where metamodel AddressBook.tcs is defined to be the
> AddressBook.tcs.ecore file.
>
> When I execute this I get:
> text2model:
> [am3.loadModel] Loading of model M
> [am3.loadModel] no type named 'ConcreteSyntax' in metamodel
> 'AddressBook.tcs'
> [am3.loadModel] java.lang.NullPointerException
> [am3.loadModel] at
> org.atl.engine.repositories.emf4atl.ASMEMFModel.newModelElem ent(ASMEMFModel.java:206)
>
> [am3.loadModel] at
> org.atl.engine.vm.nativelib.ASMModel.newModelElement(ASMMode l.java:74)
> [am3.loadModel] at
> org.atl.engine.vm.nativelib.ASMModel.newModelElement(ASMMode l.java:62)
> (stack continues...)
>
> I've examined the AddressBook.tcs.ecore and it does contain the
> ConcreteSyntax type, so I'm a bit confused.
>
> Again, any help would be greatly appreciated.
>
> Thanks
> Paul
>
--
--------------------------------------------------------
Hugo Bruneliere - R&D Engineer
ATLAS Group (INRIA & LINA) - University of Nantes
2, rue de la Houssiniere
44322 Nantes Cedex 3 - France
office +33 2 51 12 58 10 /\ cell.+33 6 07 42 45 30
EMail: Hugo.Bruneliere@univ-nantes.fr
http://www.sciences.univ-nantes.fr/lina/atl/
--------------------------------------------------------
|
|
|
Re: [TCS] Examples that convert .tcs file to model [message #571812 is a reply to message #375981] |
Fri, 23 February 2007 10:49  |
Eclipse User |
|
|
|
Hugo,
Thanks for your reply. Unfortunately changing the metamodel as you
suggested has resulted in the same type of error (no type named
'ConcreteSyntax' in metamodel 'AddressBook').
I suspect the injector is expecting to find the TCS metamodel. If that's
the case then I wonder how I can load a text file using my metamodel.
Paul
|
|
|
Re: [TCS] Examples that convert .tcs file to model [message #571952 is a reply to message #375973] |
Mon, 26 February 2007 17:11  |
Eclipse User |
|
|
|
Hi Paul,
Paul Gribben a écrit :
> Thanks for this sample Freddy, it works fine.
>
> I've extended my project copy by defining a metamodel for the
> AddressBook by handcrafting an AddressBook.km3 (reverse-engineered from
> the AddressBook.tcs, is there a more clever way to produce the
> metamodel?).
The normal process is to create first your metamodel ;-)
> I've then successfully extracted a model file
> (AddressBook1.ecore) to a text file (AddressBook1.out) using the ant
> task am3.saveModel (with extractor embedded element).
>
> I then tried to transform the text file back to a model file using the
> am3.loadModel with injector approach, but without success as follows:
>
> <target name="text2model" depends="loadModels">
> <am3.loadModel modelHandler="EMF" name="M" metamodel="AddressBook.tcs"
> path="${path}output/AddressBook1.out">
> <injector name="ebnf">
> <param name="name" value="TCS"/>
> <classpath>
> <pathelement location="${path}TCS/TCS-importer.jar" />
> </classpath>
> </injector>
> </am3.loadModel>
>
> <am3.saveModel model="M"
> path="${path}output/GeneratedAddressBook1.ecore"/>
> </target>
>
> .. where metamodel AddressBook.tcs is defined to be the
> AddressBook.tcs.ecore file.
>
In this case (text to model), you will need to generate and to use a
"specific" AddressBook injector (i.e. AddressBook-importer.jar).
I have created a complete TCS use case for AddressBook available here:
http://www.eclipse.org/gmt/am3/tcs/download/TCSSample.zip
And I have also started a tutorial:
http://wiki.eclipse.org/index.php/TCS/TCS_Toolkit_Tutorial
For the moment, this wiki page is only a stub. But I hope this can help
you :-)
Regards,
Freddy.
> When I execute this I get:
> text2model:
> [am3.loadModel] Loading of model M
> [am3.loadModel] no type named 'ConcreteSyntax' in metamodel
> 'AddressBook.tcs'
> [am3.loadModel] java.lang.NullPointerException
> [am3.loadModel] at
> org.atl.engine.repositories.emf4atl.ASMEMFModel.newModelElem ent(ASMEMFModel.java:206)
>
> [am3.loadModel] at
> org.atl.engine.vm.nativelib.ASMModel.newModelElement(ASMMode l.java:74)
> [am3.loadModel] at
> org.atl.engine.vm.nativelib.ASMModel.newModelElement(ASMMode l.java:62)
> (stack continues...)
>
> I've examined the AddressBook.tcs.ecore and it does contain the
> ConcreteSyntax type, so I'm a bit confused.
>
> Again, any help would be greatly appreciated.
>
> Thanks
> Paul
>
|
|
|
Powered by
FUDForum. Page generated in 0.03989 seconds