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
Hello,
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 "http://www.arvatosystems.com/fortytwo/PricingDsl"
import "http://www.eclipse.org/emf/2002/Ecore" as ecore

Model:
	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,
Michael


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: 13316
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 http://xtext.itemis.com or send a mail to xtext at itemis dot de


Need professional support for Xtext, Xpand, EMF?
Go to: https://www.itemis.com/en/xtext/
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Previous Topic:SonarQube and Xtend
Next Topic:"XtextReconcilerJob" internal error
Goto Forum:
  


Current Time: Thu Jan 23 18:15:22 GMT 2020

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

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

Back to the top