Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Text in Xtext
Text in Xtext [message #1770510] Sun, 13 August 2017 14:49 Go to next message
Ruchika Kumar is currently offline Ruchika KumarFriend
Messages: 50
Registered: January 2017
Member
Is there a data type of Text in Xtext? i.e. a string that is without inverted commas and could contain spaces in between words.
Re: Text in Xtext [message #1770513 is a reply to message #1770510] Sun, 13 August 2017 16:46 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14665
Registered: July 2009
Senior Member
short answer: no.

what do you exactly want to achieve


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Text in Xtext [message #1770515 is a reply to message #1770513] Sun, 13 August 2017 18:07 Go to previous messageGo to next message
Ruchika Kumar is currently offline Ruchika KumarFriend
Messages: 50
Registered: January 2017
Member
So could we define a terminal rule which acts as a Text and we can specify it for text fields?
I just need to define an attribute of type Text and not String.
i.e. inside the model, I can simply write the value without using " " and also use spaces.

[Updated on: Sun, 13 August 2017 18:10]

Report message to a moderator

Re: Text in Xtext [message #1770518 is a reply to message #1770515] Sun, 13 August 2017 18:54 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14665
Registered: July 2009
Senior Member
It would be more like a datatype rule

E.g.

Stuff: ID+;

But it depends on what you ant to allow inside the string
Where it sorts and where it ends etc


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Text in Xtext [message #1770519 is a reply to message #1770518] Sun, 13 August 2017 19:29 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7655
Registered: July 2009
Senior Member
Hi

I suspect that you will find that a grammar with non-spacing spaces and without enclosing quotes for spaces is very hard to develop and probably also really painful to use. I strongly suggest a rethink. If it is useable, then perhaps it is so simple that you can handcraft a lexer/parser.

Regards

Ed Willink

Re: Text in Xtext [message #1770979 is a reply to message #1770519] Sun, 20 August 2017 12:12 Go to previous messageGo to next message
Ruchika Kumar is currently offline Ruchika KumarFriend
Messages: 50
Registered: January 2017
Member
Thank you both for your replies.
But ID+ would not allow me to add numbers and special characters in the feature's value. I want simple text which could include anything ranging from numbers, special chars, chars to spaces.
Re: Text in Xtext [message #1770984 is a reply to message #1770979] Sun, 20 August 2017 16:02 Go to previous message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14665
Registered: July 2009
Senior Member
You have to list them all

Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Previous Topic:IDEA Plugin Error: ClasscastException
Next Topic:DerivedState filter events
Goto Forum:
  


Current Time: Thu Apr 18 14:50:14 GMT 2024

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

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

Back to the top