Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Accessing an EObject's source
Accessing an EObject's source [message #1350741] Mon, 12 May 2014 20:14 Go to next message
Michael Bischoff is currently offline Michael BischoffFriend
Messages: 14
Registered: August 2012
Junior Member
I'm creating a DSL to define some business rules.

The top level rule is very simple:

grammar com.arvatosystems.fortytwo.PricingDsl with org.eclipse.xtext.common.Terminals

generate pricingDsl ""
import "" as ecore

	rules += PricingRule*;

Now, during code generation, I want to supply the source code for every parsed PricingRule object as a comment to the generated code.
Is it possible to obtain that data?

Best regards,

Re: Accessing an EObject's source [message #1351692 is a reply to message #1350741] Tue, 13 May 2014 05:53 Go to previous message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 13525
Registered: July 2009
Senior Member
Hi you can use the nodemodelutil to obtain the (composite) node that
represents an eobject. And a node can be asked for its text

Need training, onsite consulting or any other kind of help for Xtext?
Go visit or send a mail to xtext at itemis dot de

Need professional support for Xtext, Xpand, EMF?
Go to:
Twitter : @chrdietrich
Blog :
Previous Topic:SonarQube and Xtend
Next Topic:"XtextReconcilerJob" internal error
Goto Forum:

Current Time: Sun Aug 09 15:36:30 GMT 2020

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

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

Back to the top