| single quotes in Xtext [message #999292] |
Fri, 11 January 2013 13:36  |
Adnan AL-SOSWA Messages: 21 Registered: May 2010 |
Junior Member |
|
|
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] Report message to a moderator
|
|
|
| Re: single quotes in Xtext [message #999322 is a reply to message #999292] |
Fri, 11 January 2013 15:22   |
Alexander Nittka Messages: 1081 Registered: July 2009 |
Senior Member |
|
|
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
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
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.01688 seconds