Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » scoping Problem?
scoping Problem? [message #900289] Mon, 06 August 2012 07:33 Go to next message
Sönke S is currently offline Sönke S
Messages: 2
Registered: August 2012
Junior Member
I have a problem with nameresolving.

what i want to write:
flow Flow1
   call Flow2 with para2;

flow Flow2
   inSlot
      inputPara para2


what i have to write:
flow Flow1
   call Flow2 with Flow2.para2

flow Flow2
   inSlot
      inputPara para2


My gramma looks like:
Flow:
"flow" name = ID
   ("inSlot" inSlots = InSlot)*
   ("call:" calledFlow = [Flow|FQN] "with" callPara = [Parameter|FQN])*
;

InSlot:
   "inputPara" parameter = Parameter
;

Parameter:
   name = ID
;


So what i have to do to get the expected behavior?
Thanks
Re: scoping Problem? [message #900377 is a reply to message #900289] Mon, 06 August 2012 13:36 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian Dietrich
Messages: 6205
Registered: July 2009
Senior Member
Hi,

what about customizing the IQualifiedNameProvider

public class MyQNP extends DefaultDeclarativeQualifiedNameProvider {
	
	QualifiedName qualifiedName(Parameter p) {
		return QualifiedName.create(p.getName());
	}

}

public class MyDslRuntimeModule extends org.xtext.example.mydsl1.AbstractMyDslRuntimeModule {

	@Override
	public Class<? extends IQualifiedNameProvider> bindIQualifiedNameProvider() {
		return MyQNP.class;
	}
	
}


btw you should fix your buggy grammar regarding assignment and multiplicity

Regards
Christian
Re: scoping Problem? [message #900460 is a reply to message #900377] Tue, 07 August 2012 03:58 Go to previous messageGo to next message
Sönke S is currently offline Sönke S
Messages: 2
Registered: August 2012
Junior Member
Hi Christian
thanks for the advice and sorry about that incorrect gramma. it was just a example.

Your solution works great expect the case you have two flows with the same inSlot Parameter names.
eg:

flow Flow1
   call Flow2 with para2  

flow Flow2
   inSlot
      inputPara para2


flow Flow3
   inSlot
      inputPara para2  //with your solution this doesn't work


is there a solution witch fix that one too?
Re: scoping Problem? [message #900469 is a reply to message #900460] Tue, 07 August 2012 04:34 Go to previous message
Christian Dietrich is currently offline Christian Dietrich
Messages: 6205
Registered: July 2009
Senior Member
Hi i don't know your semantics so I cannot tell you how to fix scoping

--
Need training, onsite consulting or any other kind of help for Xtext?
Go visit http://xtext.itemis.com or send a mail to xtext at itemis dot de
Previous Topic:Contentassist for imports
Next Topic:Changing Source Folders
Goto Forum:
  


Current Time: Thu Aug 21 22:15:10 EDT 2014

Powered by FUDForum. Page generated in 0.01751 seconds