Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Cannot remove org.eclipse.xtext.common.Terminals from gramma
Cannot remove org.eclipse.xtext.common.Terminals from gramma [message #1066809] Thu, 04 July 2013 13:25 Go to next message
kon f is currently offline kon fFriend
Messages: 152
Registered: March 2012
Senior Member
Hey,

I would like to remove the org.eclipse.xtext.common.Terminals import from my grammar to avoid the following error message:

The following token definitions can never be matched because prior tokens match the same input: RULE_INT


It is caused by my terminal rule:

terminal VALUE:
	('a'..'z' | 'A'..'Z' | '_' | '\\' | '\\(' | '\\)' | '\\ ' | '\\@' | '0'..'9')+;


If I remove the grammar "with org.eclipse.xtext.common.Terminals" from the header of the file, the terminal rule is marked with an error: Cannot create datatype VALUE.

Is there a way to completely remove org.eclipse.xtext.common.Terminals?

Thank you.

Kon
Re: Cannot remove org.eclipse.xtext.common.Terminals from gramma [message #1066815 is a reply to message #1066809] Thu, 04 July 2013 13:48 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14665
Registered: July 2009
Senior Member
Hi simply remove The with clause and copy what you need

--
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


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Cannot remove org.eclipse.xtext.common.Terminals from gramma [message #1066827 is a reply to message #1066815] Thu, 04 July 2013 14:16 Go to previous messageGo to next message
kon f is currently offline kon fFriend
Messages: 152
Registered: March 2012
Senior Member
Hey Christian,

I have tried this:

grammar com.project.test.properties.MyDsl /*with org.eclipse.xtext.common.Terminals*/


But it results in:

index.php/fa/15477/0/

with the error message: Cannot create datatype VALUE

Is this a bug? I'm using 2.4.2.

Thank you.

Kon

[Updated on: Thu, 04 July 2013 14:18]

Report message to a moderator

Re: Cannot remove org.eclipse.xtext.common.Terminals from gramma [message #1066829 is a reply to message #1066827] Thu, 04 July 2013 14:25 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14665
Registered: July 2009
Senior Member
Hi,

you have to import ecore (as it is done in terminals gramamr)


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Cannot remove org.eclipse.xtext.common.Terminals from gramma [message #1066831 is a reply to message #1066809] Thu, 04 July 2013 14:44 Go to previous message
kon f is currently offline kon fFriend
Messages: 152
Registered: March 2012
Senior Member
Thank you Christian Smile

grammar com.project.test.properties.MyDsl /*with org.eclipse.xtext.common.Terminals*/

import "http://www.eclipse.org/emf/2002/Ecore" as ecore


This works now Smile

Thank you!

Kon
Previous Topic:hints for a grammar
Next Topic:Deploying xtext parser to standalone jar
Goto Forum:
  


Current Time: Sat Apr 20 04:21:55 GMT 2024

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

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

Back to the top