Skip to main content



      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 07:08 Go to next message
Eclipse UserFriend
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 07:38] by Moderator

Re: Xtext grammar question (XIntLiteral cannot be resolved to a rule) [message #1145305 is a reply to message #1145242] Sat, 19 October 2013 08:09 Go to previous messageGo to next message
Eclipse UserFriend
Ä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
Re: Xtext grammar question (XIntLiteral cannot be resolved to a rule) [message #1145362 is a reply to message #1145305] Sat, 19 October 2013 09:02 Go to previous messageGo to next message
Eclipse UserFriend
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 09:02] by Moderator

Re: Xtext grammar question (XIntLiteral cannot be resolved to a rule) [message #1145379 is a reply to message #1145362] Sat, 19 October 2013 09:18 Go to previous messageGo to next message
Eclipse UserFriend
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
Re: Xtext grammar question (XIntLiteral cannot be resolved to a rule) [message #1147060 is a reply to message #1145379] Sun, 20 October 2013 12:12 Go to previous messageGo to next message
Eclipse UserFriend
Ok, this is the grammar that I need to analize.

[Updated on: Mon, 21 October 2013 08:50] by Moderator

Re: Xtext grammar question (XIntLiteral cannot be resolved to a rule) [message #1147093 is a reply to message #1147060] Sun, 20 October 2013 12:39 Go to previous messageGo to next message
Eclipse UserFriend
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
Re: Xtext grammar question (XIntLiteral cannot be resolved to a rule) [message #1148359 is a reply to message #1147093] Mon, 21 October 2013 08:51 Go to previous message
Eclipse UserFriend
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: Mon Jul 07 00:20:09 EDT 2025

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

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

Back to the top