Skip to main content



      Home
Home » Modeling » TMF (Xtext) » Workflow for writing a value converter
Workflow for writing a value converter [message #63009] Sun, 26 July 2009 12:40 Go to next message
Eclipse UserFriend
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 Go to previous message
Eclipse UserFriend
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
Previous Topic:[XText] unknown behavior
Next Topic:Comment line rule in Xtext
Goto Forum:
  


Current Time: Thu May 29 08:35:06 EDT 2025

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

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

Back to the top