Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » default value for INT parameter(default value for INT parameter)
default value for INT parameter [message #1053162] Thu, 02 May 2013 18:59 Go to next message
Vincent De Bry is currently offline Vincent De BryFriend
Messages: 49
Registered: May 2013
Member
Hi,

Is it possible, in the grammar, to define a default value for an parameter ?

The thing is ok for ENUM as the first value is proposed.

But, basically with an integer parameter definition as the following:

Test:'Test' param=INT;

upon content assist, I would like to have a proposal with a given value (lets say 36 for example). Basically, the proposale is "param".

And what about ID default value, the same way ?

thanks.
Re: default value for INT parameter [message #1053177 is a reply to message #1053162] Thu, 02 May 2013 20:59 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 6550
Registered: July 2009
Senior Member
Hi,

simply customizing yourdslproposlprovider doesnt work?
Re: default value for INT parameter [message #1053178 is a reply to message #1053177] Thu, 02 May 2013 21:24 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 6550
Registered: July 2009
Senior Member
class MyDslProposalProvider extends AbstractMyDslProposalProvider {

override completeTest_Param(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
acceptor.accept(createCompletionProposal("42", context));
}

}
Re: default value for INT parameter [message #1053205 is a reply to message #1053178] Fri, 03 May 2013 06:32 Go to previous message
Vincent De Bry is currently offline Vincent De BryFriend
Messages: 49
Registered: May 2013
Member
Hi,

I thought there perhaps something could have been specified in the xtext file.
If not, ok, I will customize the proposal provider.

Thanks.
Previous Topic:Xtext with ATL
Next Topic:Refactoring breaks Scoping
Goto Forum:
  


Current Time: Sat Dec 20 15:06:17 GMT 2014

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

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