Skip to main content



      Home
Home » Modeling » TMF (Xtext) » single quotes in Xtext
single quotes in Xtext [message #999292] Fri, 11 January 2013 13:36 Go to next message
Eclipse UserFriend
Hi all
I have this rule in xtext grammer

rule: "'"name=ID"'"
Why this rule not accepted when I check it in the editor with this example
'java'
i have error that expected "'"
I do not want to use terminal String for this difinition as when I do so and try to access the name feauture from with in code,I got the result with quotes .

Thanks in advance

[Updated on: Fri, 11 January 2013 13:47] by Moderator

Re: single quotes in Xtext [message #999322 is a reply to message #999292] Fri, 11 January 2013 15:22 Go to previous messageGo to next message
Eclipse UserFriend
Hi,

the rule will be problematic if you use the default terminals, as the STRING rule includes single quotes.

Why don't you use

Rule: name=STRING?

You could use validation that the content of the string matches an ID. Note that for referencing you then use

Reference: 'ref' to=[Rule|STRING]

Alex
Re: single quotes in Xtext [message #999338 is a reply to message #999322] Fri, 11 January 2013 16:26 Go to previous messageGo to next message
Eclipse UserFriend
Hi alex

thanks for reply .
actally when I use STRING , and try to access feature name from within xtend/xpand code
for example
<<f.name>>
the result which i get is 'java' with single quotes. I wanted single quotes to be mandatory but not part of the feature name.
Re: single quotes in Xtext [message #999523 is a reply to message #999338] Sat, 12 January 2013 05:22 Go to previous message
Eclipse UserFriend
Hi, the quotes should be removed by the value converter. This happens
automatically with the default setup.

--
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
Previous Topic:Installing multiple versions of a DSL
Next Topic:Looking for XText Developer in Zuirch Switzerland
Goto Forum:
  


Current Time: Tue Jul 15 05:46:31 EDT 2025

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

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

Back to the top