Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Xtext grammar question (XIntLiteral cannot be resolved to a rule)
Xtext grammar question (XIntLiteral cannot be resolved to a rule) [message #1145242] Sat, 19 October 2013 11:08 Go to next message
d 627 is currently offline d 627Friend
Messages: 28
Registered: March 2013
Junior Member
Hi there

I have been trying to work with a previous version of a grammar that I need to analize.

This is the head of the grammar:

grammar xxxx.dsl.xxxxx with org.eclipse.xtext.xbase.Xbase

generate xxxxx "http://xxxx.sf.net/xxxx"

import "http://www.eclipse.org/xtext/xbase/Xbase" as xbase

One rule of the grammar is this:

XLiteral returns xbase::XExpression:
	EnvironmentAccess |
	XClosure |
	XBooleanLiteral |
	[b]XIntLiteral[/b] |
	XNullLiteral |
	XStringLiteral |
	XTypeLiteral
;


XExpression is pointed as a EClass. In the rest of the grammar there aren't rules such as XClosure, XBoolean and so on. In my ignorance I suppose this is because they are part of the xbase implemented in the head of the grammar or they are interfaces based on the XExpression EClase (I'm not so sure about this). The thing is, at the begining I have problems with xtext trying to recognize this alternatives, that is why I have added in the MANIFEST.MF file of the folder that contains the definition of the grammar the next dependencies:

 org.eclipse.xtext.xbase;bundle-version="2.3.1",
 org.eclipse.xtext.purexbase;bundle-version="2.3.1",
 org.eclipse.xtext.purexbase.source;bundle-version="2.3.1",
 org.eclipse.xtext.purexbase.ui;bundle-version="2.3.1",
 org.eclipse.xtext.purexbase.ui.source;bundle-version="2.3.1",
 org.eclipse.xtext.xbase.junit;bundle-version="2.3.1",
 org.eclipse.xtext.xbase.junit.source;bundle-version="2.3.1",
 org.eclipse.xtext.xbase.lib.source;bundle-version="2.3.1",
 org.eclipse.xtext.xbase.source;bundle-version="2.3.1",
 org.eclipse.xtext.xbase.ui;bundle-version="2.3.1",
 org.eclipse.xtext.xbase.ui.source;bundle-version="2.3.1"


After doing this xtext recognized all the alternatives except for XIntLiteral, it still indicates me "XIntLiteral cannot be resolved to a rule" but I don't understand why this is the only one that is not recognize.

What can be happening, or where can I go to see the defitions of this alternatives....

Thanks a lot for your time.

[Updated on: Sat, 19 October 2013 11:38]

Report message to a moderator

Re: Xtext grammar question (XIntLiteral cannot be resolved to a rule) [message #1145305 is a reply to message #1145242] Sat, 19 October 2013 12:09 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 13655
Registered: July 2009
Senior Member
Ähm maybe you have a type and mean XNumberLiteral?

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


Need professional support for Xtext, Xpand, EMF?
Go to: https://www.itemis.com/en/it-services/methods-and-tools/xtext
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Xtext grammar question (XIntLiteral cannot be resolved to a rule) [message #1145362 is a reply to message #1145305] Sat, 19 October 2013 13:02 Go to previous messageGo to next message
d 627 is currently offline d 627Friend
Messages: 28
Registered: March 2013
Junior Member
No Christian, that's the definition of this rule in this grammar. It is a little bit strange because I have found the reference to the XintLiteral, but I don't know if maybe before this interface was part of Xbase.

[Updated on: Sat, 19 October 2013 13:02]

Report message to a moderator

Re: Xtext grammar question (XIntLiteral cannot be resolved to a rule) [message #1145379 is a reply to message #1145362] Sat, 19 October 2013 13:18 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 13655
Registered: July 2009
Senior Member
Hi can you please post something I can copy and paste ?

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


Need professional support for Xtext, Xpand, EMF?
Go to: https://www.itemis.com/en/it-services/methods-and-tools/xtext
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Xtext grammar question (XIntLiteral cannot be resolved to a rule) [message #1147060 is a reply to message #1145379] Sun, 20 October 2013 16:12 Go to previous messageGo to next message
d 627 is currently offline d 627Friend
Messages: 28
Registered: March 2013
Junior Member
Ok, this is the grammar that I need to analize.

[Updated on: Mon, 21 October 2013 12:50]

Report message to a moderator

Re: Xtext grammar question (XIntLiteral cannot be resolved to a rule) [message #1147093 is a reply to message #1147060] Sun, 20 October 2013 16:39 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 13655
Registered: July 2009
Senior Member
Hi I had a look into xbase.Xtext version history and it looks like it
changed xintinteral to xnumberliteral in Feb. 2012 (Xtext 2.3.0 I
think)

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


Need professional support for Xtext, Xpand, EMF?
Go to: https://www.itemis.com/en/it-services/methods-and-tools/xtext
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Xtext grammar question (XIntLiteral cannot be resolved to a rule) [message #1148359 is a reply to message #1147093] Mon, 21 October 2013 12:51 Go to previous message
d 627 is currently offline d 627Friend
Messages: 28
Registered: March 2013
Junior Member
Thanks a lot for your consideration and time

Regards
Previous Topic:Problems with scoping after migrating to xtext 2.0
Next Topic:Work on Xtext
Goto Forum:
  


Current Time: Tue Nov 24 03:00:22 GMT 2020

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

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

Back to the top