Skip to main content



      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 09:25 Go to next message
Eclipse UserFriend
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 09:48 Go to previous messageGo to next message
Eclipse UserFriend
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
Re: Cannot remove org.eclipse.xtext.common.Terminals from gramma [message #1066827 is a reply to message #1066815] Thu, 04 July 2013 10:16 Go to previous messageGo to next message
Eclipse UserFriend
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 10:18] by Moderator

Re: Cannot remove org.eclipse.xtext.common.Terminals from gramma [message #1066829 is a reply to message #1066827] Thu, 04 July 2013 10:25 Go to previous messageGo to next message
Eclipse UserFriend
Hi,

you have to import ecore (as it is done in terminals gramamr)
Re: Cannot remove org.eclipse.xtext.common.Terminals from gramma [message #1066831 is a reply to message #1066809] Thu, 04 July 2013 10:44 Go to previous message
Eclipse UserFriend
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 Jul 12 05:32:24 EDT 2025

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

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

Back to the top