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 14:11 Go to next message
Erick Fonseca is currently offline Erick Fonseca
Messages: 63
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 01:38 Go to previous messageGo to next message
Alexander Nittka is currently offline Alexander Nittka
Messages: 1151
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 14:14 Go to previous message
Erick Fonseca is currently offline Erick Fonseca
Messages: 63
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: Mon Sep 01 10:02:26 EDT 2014

Powered by FUDForum. Page generated in 0.01947 seconds