Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Another scoping Problem
Another scoping Problem [message #1077289] Thu, 01 August 2013 13:49 Go to next message
Chris Hansen is currently offline Chris HansenFriend
Messages: 20
Registered: July 2013
Junior Member
Hello,

I have a Problem using the Scoping.
My formerly created DSL looked like:

Filterchain:  
	"filterchain" name = ID "{"
	inport += FCInport*
	outport += FCOutport*
	("use" use += FCUseFilter)+
	"}"
;


I had written a Scoping-Method:

return Scopes.scopeFor(ctx.getUfcf().getType().getUse());
,
where getUse() returned all FCUseFilter Elements.

Now I've changed the DSL a little bit:

Filterchain:  
	"filterchain" name = ID "{"
	inport += FCInport*
	outport += FCOutport*
	("use" use += FilterchainPart)+
	"}"
;

FilterchainPart:
	"filter" filter = FCUseFilter
;



This is necessary because "use" shall be able to contain other Objects later on.

But now I can't create the Scioping-Method.
My Idea was :

return Scopes.scopeFor(ctx.getUfcf().getType().getUse().filter([ t | t.filter != null)


The problem there is that I don't want to receive the "FilterchainPart" but the FCUseFilter, contained in FilterchainPart.
But I don't know how to access them because "getUse()" (of course) returns an EList<FilterchainPart>.

How do I get the FCUseFilter out there?

Thanks,
Chris
Re: Another scoping Problem [message #1080093 is a reply to message #1077289] Mon, 05 August 2013 13:06 Go to previous messageGo to next message
Chris Hansen is currently offline Chris HansenFriend
Messages: 20
Registered: July 2013
Junior Member
No ideas?

I've tried to build up an EList<FilterchainPart> by Hand, the Code compiles but doesn't cause any Action.
Re: Another scoping Problem [message #1080870 is a reply to message #1080093] Tue, 06 August 2013 13:23 Go to previous message
Jan Koehnlein is currently offline Jan KoehnleinFriend
Messages: 760
Registered: July 2009
Location: Hamburg
Senior Member
Use map[] to execute a lambda on all elements of an iterable:

return Scopes.scopeFor(ctx
.getUfcf()
.getType()
.getUse()
.map[filter]
.filterNull



Am 05.08.13 15:06, schrieb Chris Hansen:
> No ideas?
>
> I've tried to build up an EList<FilterchainPart> by Hand, the Code
> compiles but doesn't cause any Action.


--
Need professional support for Eclipse Modeling?
Go visit: http://xtext.itemis.com


---
Get professional support from the Xtext committers at www.typefox.io
Previous Topic:[xtext 2] forms-integration.
Next Topic:Case Insensitivity for the 5 min Tutorial
Goto Forum:
  


Current Time: Mon May 13 14:40:18 GMT 2024

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

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

Back to the top