Eclipse Community Forums - RDF feed
https://www.eclipse.org/forums/
Eclipse Community ForumsRe: [TCS] Examples that convert .tcs file to model
https://www.eclipse.org/forums/index.php/mv/msg/123138/375967/#msg_375967
Paul Gribben a écrit :
> Hi, sorry if I've used the wrong group for this question.
Maybe this question would be better asked on the GMT newsgroup, which
I've added to the "to" list.
>
> I'm looking for any working example that converts a source .tcs file
> into a TCS conformant model file.
I'd also be interested to know whether
> TCS is good choice for converting from models to concrete text (I won't
> need to go from text to model), or should I use another approach?
>
Yes, TCS provides you a bridge between models and concrete text (text to
model and model to text).
Hope this help ;-)
Regards,
Freddy.
--
Freddy Allilaire - ATLAS Group (INRIA & LINA) http://www.sciences.univ-nantes.fr/lina/atl/contrib/allilair e]]>Freddy Allilaire2007-02-22T17:34:13-00:00Re: [TCS] Examples that convert .tcs file to model
https://www.eclipse.org/forums/index.php/mv/msg/123138/375968/#msg_375968
Paul Gribben2007-02-23T07:56:49-00:00Re: [TCS] Examples that convert .tcs file to model
https://www.eclipse.org/forums/index.php/mv/msg/123138/571593/#msg_571593
Paul Gribben2007-02-23T07:56:49-00:00Re: [TCS] Examples that convert .tcs file to model
https://www.eclipse.org/forums/index.php/mv/msg/123138/571690/#msg_571690
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:
... 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]]>Paul Gribben2007-02-23T10:05:41-00:00Re: [TCS] Examples that convert .tcs file to model
https://www.eclipse.org/forums/index.php/mv/msg/123138/375973/#msg_375973
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:
... 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]]>Paul Gribben2007-02-23T10:05:41-00:00Re: [TCS] Examples that convert .tcs file to model
https://www.eclipse.org/forums/index.php/mv/msg/123138/571777/#msg_571777
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/
--------------------------------------------------------]]>Hugo Bruneliere2007-02-23T14:14:49-00:00Re: [TCS] Examples that convert .tcs file to model
https://www.eclipse.org/forums/index.php/mv/msg/123138/375981/#msg_375981
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/
--------------------------------------------------------]]>Hugo Bruneliere2007-02-23T14:14:49-00:00Re: [TCS] Examples that convert .tcs file to model
https://www.eclipse.org/forums/index.php/mv/msg/123138/571812/#msg_571812
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]]>Paul Gribben2007-02-23T15:49:52-00:00Re: [TCS] Examples that convert .tcs file to model
https://www.eclipse.org/forums/index.php/mv/msg/123138/375983/#msg_375983
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]]>Paul Gribben2007-02-23T15:49:52-00:00Re: [TCS] Examples that convert .tcs file to model
https://www.eclipse.org/forums/index.php/mv/msg/123138/571952/#msg_571952
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).
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
>]]>Freddy Allilaire2007-02-26T22:11:35-00:00Re: [TCS] Examples that convert .tcs file to model
https://www.eclipse.org/forums/index.php/mv/msg/123138/375991/#msg_375991
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).
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
>]]>Freddy Allilaire2007-02-26T22:11:35-00:00