Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » scoping Problem?
scoping Problem? [message #900289] Mon, 06 August 2012 11:33 Go to next message
Sönke S is currently offline Sönke SFriend
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 17:36 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14665
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


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: scoping Problem? [message #900460 is a reply to message #900377] Tue, 07 August 2012 07:58 Go to previous messageGo to next message
Sönke S is currently offline Sönke SFriend
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 08:34 Go to previous message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14665
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


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Previous Topic:Contentassist for imports
Next Topic:Changing Source Folders
Goto Forum:
  


Current Time: Thu Apr 18 23:43:56 GMT 2024

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

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

Back to the top