Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » XExpression to String
XExpression to String [message #1060395] Fri, 24 May 2013 09:18 Go to next message
Marc Z is currently offline Marc Z
Messages: 7
Registered: July 2012
Junior Member
Hi,

how can I transform a complete XEpression as entered into the editor into a String using Java?
toString() results in a string of the responding class.

Can anyone help?

Marc
Re: XExpression to String [message #1060401 is a reply to message #1060395] Fri, 24 May 2013 09:34 Go to previous messageGo to next message
Alexander Nittka is currently offline Alexander Nittka
Messages: 1085
Registered: July 2009
Senior Member
Hi,

Use NodeModelUtils to obtain the parse tree node and ask it for the text.

Alex


Need training, onsite consulting or any other kind of help for Xtext?
Go visit http://xtext.itemis.com or send a mail to xtext@itemis.de

[Updated on: Fri, 24 May 2013 09:34]

Report message to a moderator

Re: XExpression to String [message #1060402 is a reply to message #1060395] Fri, 24 May 2013 09:36 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian Dietrich
Messages: 4444
Registered: July 2009
Senior Member
Have a look at NodeModel (via nodemodelutil) you can ask a inode 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
Re: XExpression to String [message #1060411 is a reply to message #1060395] Fri, 24 May 2013 10:13 Go to previous message
Marc Z is currently offline Marc Z
Messages: 7
Registered: July 2012
Junior Member
Thx, works great!

Marc
Previous Topic:Set XText content-type to UTF-8
Next Topic:Creating xtext file as model from GMF
Goto Forum:
  


Current Time: Tue May 28 17:09:58 EDT 2013

Powered by FUDForum. Page generated in 0.01469 seconds