Workflow for writing a value converter [message #63009] |
Sun, 26 July 2009 12:40  |
Eclipse User |
|
|
|
Originally posted by: ogucuk.gmail.com
Hi,
sorry if this is a dumb question but what is the workflow for writing a
value converter for e.g. removing the quotes in the STRING rule? i.e.
1. which class does my value converter has to extend? (there are a few
AbstractValueConverter classes in org.eclipse.xtext.conversion.impl and
I have no idea, which one is for what.. Plus, I tried to extend the
AbstractAnnotationBasedValueConverterService as told in
http://www.eclipse.org/Xtext/documentation/0_7_0/xtext.html# valueconverter
but Eclipse says, that the AbstractAnnotationBasedValueConverter
couldn't be find...)
2. which one is the method, I have to overwrite in my ValueConverter class?
3. where do I bind my value converter implementation to what?
sorry, but I simply don't understand anything from this part of the
documentation :(
Many thanks
mN
|
|
|
Re: Workflow for writing a value converter [message #63013 is a reply to message #63009] |
Mon, 27 July 2009 02:54  |
Eclipse User |
|
|
|
Hi mN,
You are right, there is no AbstractAnnotationBasedValueConverterService. The
abstract base class is actually called AbstractDeclarativeValueConverterService.
Although if your grammar extends the Terminals grammar it typically makes more
sense to extend the class DefaultTerminalConverters, which includes
conversions for "ID", "INT", and "STRING".
I will update the documentation accordingly. Thanks for the pointer.
Hope that helps,
--knut
myName wrote:
> Hi,
>
> sorry if this is a dumb question but what is the workflow for writing a
> value converter for e.g. removing the quotes in the STRING rule? i.e.
>
> 1. which class does my value converter has to extend? (there are a few
> AbstractValueConverter classes in org.eclipse.xtext.conversion.impl and
> I have no idea, which one is for what.. Plus, I tried to extend the
> AbstractAnnotationBasedValueConverterService as told in
> http://www.eclipse.org/Xtext/documentation/0_7_0/xtext.html# valueconverter
> but Eclipse says, that the AbstractAnnotationBasedValueConverter
> couldn't be find...)
>
> 2. which one is the method, I have to overwrite in my ValueConverter class?
>
> 3. where do I bind my value converter implementation to what?
>
> sorry, but I simply don't understand anything from this part of the
> documentation :(
>
> Many thanks
>
> mN
|
|
|
Powered by
FUDForum. Page generated in 0.05806 seconds