Skip to main content



      Home
Home » Modeling » TMF (Xtext) » [TCS] *.ann file?
[TCS] *.ann file? [message #24444] Wed, 17 December 2008 04:29 Go to next message
Eclipse UserFriend
Originally posted by: johannes.brunner.fh-hagenberg.at

Hi all,
what's about with this *.ann file.
I can't find any documentation how to use this file with TCS or what's about this ann file.
I get warnings from the ann file.

What I did so far:
I created a new TCS project and everything worked fine.
The next step was to create a custom metamodell, I already had an
ecore metamodel, so I used "Extract Ecore Metamodel to KM3".
Now I used "Inject KM3 Metamodel to Ecore metamodel" (I don't know if this is really necessary)
I customized my tcs file to correspond with the new metamodel and used
"Inject X file to X model" and everything worked still fine,
beside the warnings from the ann file which I didn't touch.

The ann file looks like (the name of the language is tropic
and the file extension for the language is *.net):

annotate tropic { --> WARNING: could not set location of myTarget!<notnamedyet>, disabling further location settings
annotate tropic with
nsURI='tropic', --> WARNING: could not set comments of myTarget!<unnamed>, disabling further comments
nsPrefix='tropic';

annotate PrimitiveTypes with
nsURI='tropic-PrimitiveTypes',
nsPrefix='pt';

annotate "PrimitiveTypes::Boolean" with
instanceClassName='boolean';

annotate "PrimitiveTypes::Double" with
instanceClassName='double';

annotate "PrimitiveTypes::Integer" with
instanceClassName='int';

annotate "PrimitiveTypes::String" with
instanceClassName='java.lang.String';
}

I get the following two warnings from my ann file and one from my
textual model file (models have the extension .net):

could not set comments of myTarget!<unnamed>, disabling further comments setting | tropic.ann | tropic/Metamodel line 3, column 3

could not set location of myTarget!<notnamedyet>, disabling further location settings | tropic.ann | tropic/Metamodel line 1, column 10

could not set location of model.xmi!<unnamed>, disabling further location settings Test1.net tropic/Samples line 1, column 1

The textual model file Test1.net looks like:

Place myplace { --> WARNING could not set location of model.xmi!<unnamed>, disabling further location settings Test1.net
capacity 5
}

Please help me to get rid of this warnings.
Re: [TCS] *.ann file? [message #24486 is a reply to message #24444] Wed, 17 December 2008 08:07 Go to previous message
Eclipse UserFriend
Johannes,

The .ann file is designed to contain annotations that will
be used in combination with the meta-model defined in the
..km3 file. Note, in Ecore annotations can be part of a model.
The developers of km3 have the more purist view that different
annotations are required for different target technologies,
thus, they should be kept separate from the meta-model.

The warnings steam from the inbuilt ability of a TCS generated
text-to-model (t2m) transformation to record source location
and comment information. The generator assumes that any model
element will have location, commentsBefore and commentsAfter
attributes that it will use to record this information. The warnings
are just warnings that these attributes were not found.

You can remove the warnings generated when processing your
..net files by making all of your meta-model elements extend,
directly or indirectly, the LocatedElement class that was
present in the template km3 file present when you created the
TCS project.

Unfortunately, as the warnings about the .ann file steam from
the attributes not being present in the annotation meta-model,
you can not get rid of these.

Andy.

"Johannes Brunner" <johannes.brunner@fh-hagenberg.at> wrote in message
news:giagp4$hpo$1@build.eclipse.org...
> Hi all,
> what's about with this *.ann file.
> I can't find any documentation how to use this file with TCS or what's
> about this ann file.
> I get warnings from the ann file.
>
> What I did so far:
> I created a new TCS project and everything worked fine.
> The next step was to create a custom metamodell, I already had an
> ecore metamodel, so I used "Extract Ecore Metamodel to KM3".
> Now I used "Inject KM3 Metamodel to Ecore metamodel" (I don't know if this
> is really necessary)
> I customized my tcs file to correspond with the new metamodel and used
> "Inject X file to X model" and everything worked still fine,
> beside the warnings from the ann file which I didn't touch.
>
> The ann file looks like (the name of the language is tropic
> and the file extension for the language is *.net):
>
> annotate tropic { --> WARNING: could not set location of
> myTarget!<notnamedyet>, disabling further location settings
> annotate tropic with
> nsURI='tropic', --> WARNING: could not set comments of myTarget!<unnamed>,
> disabling further comments
> nsPrefix='tropic';
>
> annotate PrimitiveTypes with
> nsURI='tropic-PrimitiveTypes',
> nsPrefix='pt';
>
> annotate "PrimitiveTypes::Boolean" with
> instanceClassName='boolean';
>
> annotate "PrimitiveTypes::Double" with
> instanceClassName='double';
>
> annotate "PrimitiveTypes::Integer" with
> instanceClassName='int';
>
> annotate "PrimitiveTypes::String" with
> instanceClassName='java.lang.String';
> }
> I get the following two warnings from my ann file and one from my
> textual model file (models have the extension .net):
>
> could not set comments of myTarget!<unnamed>, disabling further comments
> setting | tropic.ann | tropic/Metamodel line 3, column 3
> could not set location of myTarget!<notnamedyet>, disabling further
> location settings | tropic.ann | tropic/Metamodel line 1, column 10
>
> could not set location of model.xmi!<unnamed>, disabling further location
> settings Test1.net tropic/Samples line 1, column 1
>
> The textual model file Test1.net looks like:
>
> Place myplace { --> WARNING could not set location of model.xmi!<unnamed>,
> disabling further location settings Test1.net
> capacity 5
> }
>
> Please help me to get rid of this warnings.
>
Previous Topic:ImportMetamodel, Linker.ext error
Next Topic:[Announce] TMF XTEXT 0.7.0M4 is available
Goto Forum:
  


Current Time: Sat May 10 18:24:11 EDT 2025

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

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

Back to the top