Skip to main content



      Home
Home » Modeling » TMF (Xtext) » Customizing Serializer(Handling an EClass not referenced by a grammar rule)
Customizing Serializer [message #949709] Fri, 19 October 2012 04:03
Eclipse UserFriend
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: Mon Jul 07 14:57:44 EDT 2025

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

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

Back to the top