Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » [solved] Missing whitespace after XText serialization (Integrating XText and GMF Editors)
[solved] Missing whitespace after XText serialization [message #725622] Thu, 15 September 2011 11:20 Go to next message
Jonatan Antoni is currently offline Jonatan AntoniFriend
Messages: 18
Registered: December 2010
Location: Frankfurt/Main
Junior Member
Hello,

I have (more or less) successfully integrated the FolwerDSL example with a GMF editor.

A statemachine like

state State1
end

state State2
end


leads to the expected diagram. But adding a third state using the GMF editor, leads to a corrupt textual representation like


state State1
end

state State2
endstate State3 end


As one can see, there is some whitespace missing between the 'end' keyword of State2 and the 'state' keyword of the new State3.

I guess something is "wrong" (or let say missing) within the serialization. Can somebody give me a hint?

I have played around with the formatter, but I guess the formatter cannot fix this issue, because 'endstate' is not a valid keyword any more. What is the right way to fix such a problem?

Thanks,
Jonatan

[Updated on: Fri, 16 September 2011 11:50]

Report message to a moderator

Re: Missing whitespace after XText serialization [message #725632 is a reply to message #725622] Thu, 15 September 2011 11:40 Go to previous messageGo to next message
Jan Koehnlein is currently offline Jan KoehnleinFriend
Messages: 760
Registered: July 2009
Location: Hamburg
Senior Member
Which version of Xtext are you using?
Have you read the sections on EMF/GMF integration in the Xtext docs?


Am 15.09.11 13:20, schrieb jantoni:
> Hello,
>
> I have (more or less) successfully integrated the FolwerDSL example with
> a GMF editor.
>
> A statemachine like
>
>
> state State1
> end
>
> state State2
> end
>
>
> leads to the expected diagram. But adding a third state using the GMF
> editor, leads to a corrupt textual representation like
>
>
>
> state State1
> end
>
> state State2
> endstate State3 end
>
>
> As one can see, there is some whitespace missing between the 'end'
> keyword of State2 and the 'state' keyword of the new State3.
>
> I guess something is "wrong" (or let say missing) within the
> serialization. Can somebody give me a hint?
>
> I have played around with the formatter, but I guess the formatter
> cannot fix this issue, because 'endstate' is not a valid keyword any
> more. What is the right way to fix such a problem?
>
> Thanks,
> Jonatan
>


--
Need professional support for Eclipse Modeling?
Go visit: http://xtext.itemis.com


---
Get professional support from the Xtext committers at www.typefox.io
Re: Missing whitespace after XText serialization [message #725705 is a reply to message #725632] Thu, 15 September 2011 14:55 Go to previous messageGo to next message
Jonatan Antoni is currently offline Jonatan AntoniFriend
Messages: 18
Registered: December 2010
Location: Frankfurt/Main
Junior Member
Hello Jan,

I am using Eclipse Indigo with XText 2.0 and a development snapshot of GMF SDK 2.4.

I have read the integration docs, but that did not help so far.

My actual result is like Stage 1 in the docs. Except the missing whitespaces.

I can insert new states in both of the editors (XText and GMF). As soon as I press save, the changes propagate to the other editor. Inserting a new state using the textual XText editor works quite well. But adding a state using the graphical GMF editor leads to the described serialization error. The same problem exists for new transitions inserted using the GMF editor.

Btw: Changes to already existing elements work in both directions, state renaming for instance.

For me it looks like the serialization does not insert the needed whitespace. Do you have any ideas where this comes from? And how it may be fixed?

Thanks,
Jonatan
Re: Missing whitespace after XText serialization [message #725991 is a reply to message #725705] Fri, 16 September 2011 11:11 Go to previous messageGo to next message
Moritz Eysholdt is currently offline Moritz EysholdtFriend
Messages: 161
Registered: July 2009
Location: Kiel, Germany
Senior Member
hi jantoni,

> For me it looks like the serialization does not insert the needed
> whitespace. Do you have any ideas where this comes from? And how it may
> be fixed?

this sounds indeed like a bug in Xtext's serialization component. There
are different options for you:
- In case you are using Xtext 2.0.0, upgrade to 2.0.1 and check if the
bug still exists.
- In Xtext 2.0.x, there a are two versions of the serializer. You can
use the old version by using the "ParseTreeConstructorFragment" in your
MWE2-Workflow and you can use the new serializer by using the
"SerializerFragment" in your workflow. Since the FowlerDSL example is
quite simple, the old serializer should work just fine.

cheers,
Moritz
Re: Missing whitespace after XText serialization [message #726005 is a reply to message #725991] Fri, 16 September 2011 11:49 Go to previous messageGo to next message
Jonatan Antoni is currently offline Jonatan AntoniFriend
Messages: 18
Registered: December 2010
Location: Frankfurt/Main
Junior Member
Hello Moritz,

indeed I was still using XText 2.0.0 as it is shipped with the Eclipse Indigo release.
After updating XText to 2.0.1 all the problemes are gone.

Now it works quite well, and it looks great at the first glance. I guess I have to investigate to GMF in detail to make the graphical part really usable.

Many thanks,
Jonatan

Btw: I am using the new SerializerFragment within my workflow as it comes with the fowler example.
Re: Missing whitespace after XText serialization [message #726099 is a reply to message #726005] Fri, 16 September 2011 14:38 Go to previous message
Moritz Eysholdt is currently offline Moritz EysholdtFriend
Messages: 161
Registered: July 2009
Location: Kiel, Germany
Senior Member
Hi Jonatan,

On 16.09.11 13:49, Jonatan Antoni wrote:
> Hello Moritz,
>
> indeed I was still using XText 2.0.0 as it is shipped with the Eclipse
> Indigo release.
> After updating XText to 2.0.1 all the problemes are gone.

that's good news :D

cheers,
Moritz
Previous Topic:Text from Ecore
Next Topic:[XTEXT1] JvmParameterizedTypeReference and nested classes
Goto Forum:
  


Current Time: Fri Apr 26 23:13:35 GMT 2024

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

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

Back to the top