Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » What is the intention of invoking serialization when calling XtextResource.save()?
icon5.gif  What is the intention of invoking serialization when calling XtextResource.save()? [message #762553] Thu, 08 December 2011 09:41 Go to next message
Kevin Sun is currently offline Kevin Sun
Messages: 32
Registered: August 2010
Location: China
Member

When I rename the file test.mydsl, the serialization will be used. However, if there are some syntax errors in that file, the serialization will fail. And, the content of that file will loss. I think it is an error that the textual content of a file loss because of renaming it.

Why does not xtext keep the textual content unchanged when XtextResource.save() is called?

Can I use the parer tree serialization instead of the AST serialization?
Re: What is the intention of invoking serialization when calling XtextResource.save()? [message #762591 is a reply to message #762553] Thu, 08 December 2011 10:51 Go to previous message
Sebastian Zarnekow is currently offline Sebastian Zarnekow
Messages: 2908
Registered: July 2009
Senior Member
Hi Kevin,

the textual form is potentially out of sync with the object model. The
purpose of #save is to persist information that can be restored to an
equal instance by means of #load afterwards. It would be pointless to
persist the outdated version, wouldn't it?

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

Am 08.12.11 10:41, schrieb Kevin Sun:
> When I rename the file test.mydsl, the serialization will be used.
> However, if there are some syntax errors in that file, the serialization
> will fail. And, the content of that file will loss. I think it is an
> error that the textual content of a file loss because of renaming it.
>
> Why does not xtext keep the textual content unchanged when
> XtextResource.save() is called?
>
> Can I use the parer tree serialization instead of the AST serialization?
Previous Topic:separate spec generation from model
Next Topic:com.google.collect missing from Require-Bundles in xtext 2.2?
Goto Forum:
  


Current Time: Sat Oct 25 14:32:45 GMT 2014

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

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