Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Scope for C# like Attribute-Class
Scope for C# like Attribute-Class [message #1073266] Wed, 24 July 2013 12:38 Go to next message
Günther Fiedler is currently offline Günther Fiedler
Messages: 21
Registered: February 2013
Junior Member
Hello,

I´m currently working on a grammer for a class diagram.

I wrote a Rule called Reflection:

Reflection:
'[' name=[Attribute]('('var += [ParameterName] (','var += [ParameterName])*')') ']'
;

Attribute:
visib=Visibility 'attribute' name = ID'{'
(attributes+=Variable)*
(methodes+=Abstract_Method)*
'}'
;

Because i only want those ParameterName´s who belong to a Variable in my Reflection Rule i wrote a Scope-Operator.

IScope scope_Reflection_var(Reflection refl, EReference ref)
{
ArrayList<ParameterName> params = new ArrayList<ParameterName>();
for (Variable variable : refl.getName().getAttributes())
{
params.add(variable.getParam().getName());
}
return Scopes.scopeFor(params);
}
It seems like that i´m doing something wrong, because writing the grammer i get no propsals.

Maybe somebody can tell me what i´m doing wrong!?

Thx,
Günther
Re: Scope for C# like Attribute-Class [message #1073288 is a reply to message #1073266] Wed, 24 July 2013 13:23 Go to previous messageGo to next message
Günther Fiedler is currently offline Günther Fiedler
Messages: 21
Registered: February 2013
Junior Member
Well, after debugging and building everything new, the Scope works fine. But the intellisense does not work. Any ideas?
Re: Scope for C# like Attribute-Class [message #1073295 is a reply to message #1073288] Wed, 24 July 2013 13:35 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian Dietrich
Messages: 6397
Registered: July 2009
Senior Member
HI,

is this about ContentAssist for Attribute or for ParameterName
Re: Scope for C# like Attribute-Class [message #1073302 is a reply to message #1073295] Wed, 24 July 2013 13:45 Go to previous messageGo to next message
Günther Fiedler is currently offline Günther Fiedler
Messages: 21
Registered: February 2013
Junior Member
Hi,

ContentAssist for ParamaterName.
Re: Scope for C# like Attribute-Class [message #1073310 is a reply to message #1073302] Wed, 24 July 2013 13:54 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian Dietrich
Messages: 6397
Registered: July 2009
Senior Member
Hmm sry i have no idea, can you share a pasteable grammar and scopeprovider?
Re: Scope for C# like Attribute-Class [message #1073335 is a reply to message #1073310] Wed, 24 July 2013 14:40 Go to previous messageGo to next message
Victor Noël is currently offline Victor Noël
Messages: 112
Registered: June 2010
Senior Member
Isn't that the problem with the difference between BatchScopeProvider and ScopeProvider, the first one being used for checking and a lot of stuff while the second one is only used for content assist?
(or something like that...)
Re: Scope for C# like Attribute-Class [message #1073337 is a reply to message #1073335] Wed, 24 July 2013 14:42 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian Dietrich
Messages: 6397
Registered: July 2009
Senior Member
sorry yes this might be the case if you use xbase. did not look so from what you have posted so far.
Re: Scope for C# like Attribute-Class [message #1073707 is a reply to message #1073337] Thu, 25 July 2013 10:44 Go to previous message
Victor Noël is currently offline Victor Noël
Messages: 112
Registered: June 2010
Senior Member
If you use xbase, that's the way I found to do it: http://www.eclipse.org/forums/index.php/mv/msg/465327/1073705/#msg_1073705
Previous Topic:"scope" problem
Next Topic:A simple error break a whole file: how to avoid?
Goto Forum:
  


Current Time: Fri Oct 31 16:00:34 GMT 2014

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

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