Context-dependent Name Resolution [message #1732505] |
Tue, 17 May 2016 14:58  |
Eclipse User |
|
|
|
Hi,
Is there any way to make XText resolve names depending on the scope they're in? For instance, let's say I want to parse a programming language that supports C-like structures and a "with" keyword (just like the one in Visual Basic). That means this:
struct MyStructure { int a, b; }
MyStructure myStruct;
with (myStruct)
{
a = 5;
b = 7;
}
... should be equivalent to this:
MyStructure myStruct;
myStruct.a = 5;
myStruct.b = 7;
So, inside the "with" block, "a" and "b" need to become "myStruct.a" and "myStruct.b", respectively. I tried to implement this using scope providers, but I kept getting an error about xtext not being able to resolve the proxy objects for variables inside "with" blocks, because the fully qualified name of "a" is still "myStruct.a" and not just "a".
Is there some way to override the default proxy resolution behavior and make it scope-dependent? Or should this be implemented in some entirely different way?
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.04570 seconds