Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Redefining imported name
Redefining imported name [message #1053824] Tue, 07 May 2013 18:11 Go to next message
Erick Fonseca is currently offline Erick FonsecaFriend
Messages: 68
Registered: December 2011
Member
I'm having trouble with redefining an imported name in my DSL. I have something like this:

file1.mydsl
namespace file1

function f(x, y)
{
    return x + y
}


file2.mydsl
import file1.*

function f(x, y, z)
{
    return x + y + z
}

f(1, 2, 3)


I'd expect the definition of f in file2 to hide the one imported from file1, so the call would effectively resolve to file2.f. However, this is not happening (checked by ctrl+click on the function name and an argument count validation). What do I have to change to achieve this behavior?
Re: Redefining imported name [message #1053879 is a reply to message #1053824] Wed, 08 May 2013 05:38 Go to previous messageGo to next message
Alexander Nittka is currently offline Alexander NittkaFriend
Messages: 1193
Registered: July 2009
Senior Member
Hi,

your scoping implementation must be wrong.

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
Re: Redefining imported name [message #1057911 is a reply to message #1053879] Thu, 09 May 2013 18:14 Go to previous message
Erick Fonseca is currently offline Erick FonsecaFriend
Messages: 68
Registered: December 2011
Member
Actually, I didn't have any methods defined in my scope provider. I tried to remove rules from my grammar and rewrite them, and it worked. Not sure what happened.
Previous Topic:Using both AbstractModelInferrer and IGenerator implementations
Next Topic:XText entry rule
Goto Forum:
  


Current Time: Fri Apr 26 09:44:35 GMT 2024

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

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

Back to the top