Eclipse Community Forums - RDF feed
https://www.eclipse.org/forums/
Eclipse Community ForumsIntegrate xml file instead of own dsl into xtext framework
https://www.eclipse.org/forums/index.php/mv/msg/483212/1049710/#msg_1049710
I've used Xtext for a dsl while ago and it is pretty nice! Now, I'm working in a project where xml is used instead of an own dsl. This has been there for a while and cannot changed anymore to a dsl.
The current process implies tasks like parsing the actual xml file (jaxb), pushing all information to the EMF model and performing some semantical validation on the model. The maintenance is really time consuming and error-prone since changes have to be made on several places.
Since this entire process is quite similar to what Xtext does (except for the xml file), I was wondering if I somehow could integrate the xml format into the Xtext framework. So far, I found two difference approaches:
- Keep the current xml editor and adjust the ANTLR parser. E.g. ANTLR needs to be aware of < and > character. But this also means that I couldn't use the features that are provided by the Xtext editor like error marking, element navigation, quick fixes and so on.
- With the second approach I would reverse engineering the current xml schema file with the xtext grammar dsl, like the following example:
What do you think? Any further suggestions? Does it seem strange ?
I really appreciate your thoughts
Thank you.
Kon]]>kon f2013-04-26T07:19:35-00:00Re: Integrate xml file instead of own dsl into xtext framework
https://www.eclipse.org/forums/index.php/mv/msg/483212/1051198/#msg_1051198
your XML files as EMF resources. Then perform EMF validation on them.
Am 26.04.13 09:19, schrieb kon fri:
> Hey :)
>
> I've used Xtext for a dsl while ago and it is pretty nice! :) Now, I'm
> working in a project where xml is used instead of an own dsl. This has
> been there for a while and cannot changed anymore to a dsl.
>
> The current process implies tasks like parsing the actual xml file
> (jaxb), pushing all information to the EMF model and performing some
> semantical validation on the model. The maintenance is really time
> consuming and error-prone since changes have to be made on several places.
>
> Since this entire process is quite similar to what Xtext does (except
> for the xml file), I was wondering if I somehow could integrate the xml
> format into the Xtext framework. So far, I found two difference approaches:
>
> - Keep the current xml editor and adjust the ANTLR parser. E.g. ANTLR
> needs to be aware of < and > character. But this also means that I
> couldn't use the features that are provided by the Xtext editor like
> error marking, element navigation, quick fixes and so on.
>
> - With the second approach I would reverse engineering the current xml
> schema file with the xtext grammar dsl, like the following example:
>
>
> Model:
> greetings+=Greeting*;
>
> Greeting:
> '<Hello>' name=ID '!</Hello>';
>
> What do you think? Any further suggestions? Does it seem strange :) ?
> I really appreciate your thoughts :)
> Thank you.
>
> Kon
--
Need professional support for Eclipse Modeling?
Go visit: http://xtext.itemis.com]]>Jan Koehnlein2013-04-28T11:22:09-00:00