Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Customizing Serializer(Handling an EClass not referenced by a grammar rule)
Customizing Serializer [message #949709] Fri, 19 October 2012 08:03
Olivier Parisy is currently offline Olivier ParisyFriend
Messages: 15
Registered: June 2011
Junior Member
Hi,

I am trying to serialize an AST back to text after I performed some transformations on it. In the process, I am introducing some subclasses instances in the EMF resource, which triggers serialization errors.

I understand why (I have no rules in the grammar referencing this EClass, and I cannot simply introduce one), and the documentation clearly states that "The type of the model element must be identical to the return type of the grammar rule or the action's type. Subtypes are not allowed."

However, I would like to programmatically customize the serializer to handle this case. I tried extending ValueSerializer, but none of its methods are called for the infringing EObject.

I am currently using the ParseTreeConstructorFragment. Would the SerializerFragment provide me with more customization options with regard to this particular serialization need?

Regards.
Previous Topic:How to visualize grammar generated from Xtext in AntlrWorks
Next Topic:How to register my DSL to Java code generator?
Goto Forum:
  


Current Time: Thu Sep 19 07:45:58 GMT 2024

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

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

Back to the top