Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » manage the String type and what is generated from my dsl Grammar
manage the String type and what is generated from my dsl Grammar [message #896940] Fri, 20 July 2012 13:38 Go to next message
frank fotso is currently offline frank fotso
Messages: 91
Registered: May 2012
Member
hi All,

i would like to manage what is generated from my Dsl grammar ( that means if i have for example the following rule in my grammar :
TSenderReceiverInterface:
	(annotations +=TAnnotation)*
	 'interface' 'senderReceiver' (isService?='service')? name=ID '{'
			(dataElements += TDataElement)*
		'}'
;

after running the workflow and hte MWe2 file as an eclipse application , the edited file that i would have , i wat it such that when i using the content assist the file propose is this :
 interface senderReceiver [color=skyblue]name [/color]{
	
}
 
, ie i wanx xtext to propose me a name as default name and ii dont want to be the one entry name all the time , but what i have now , i'm the one entry the name all the time.

also i want proposed name or the enter to be unique , i was thinking that is the case when you are using ID instead of String but is not the case.

any ideas on which class i need to modify to handle that problem.

also
Re: manage the String type and what is generated from my dsl Grammar [message #896946 is a reply to message #896940] Fri, 20 July 2012 13:44 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian Dietrich
Messages: 6388
Registered: July 2009
Senior Member
Hi,

i am not quite sure if i got your problem,
but there is a completeTSenderReceiverInterface_name method or somehting like that
in YourDslProposalProvider

~Christian
Re: manage the String type and what is generated from my dsl Grammar [message #897218 is a reply to message #896946] Mon, 23 July 2012 08:54 Go to previous messageGo to next message
frank fotso is currently offline frank fotso
Messages: 91
Registered: May 2012
Member
hi,
may i did not exposed my problem clearly.

what i'm trying to said , is thiswhich function or which part in my project i'm suppose to modify if i want to manage the code completion. by choosing how the completion text will be proposed. for example:

i i have the following simple grammar :
 grammar org.xtext.example.mydsl2.MyDsl with org.eclipse.xtext.common.Terminals

generate myDsl "http://www.xtext.org/example/mydsl2/MyDsl"

Model:
	greetings+=Greeting*;
	
Greeting:
	'Hello'  '{'   name=ID '!'  '}'; 

and after running the workflow and the eclipse application , i want xtext to propose this sentence as a code completion
 Hello { name ! }
instead of proposing Hello after that , wait for me to enter the ID and after that propppose me to enter !.

so i want xtext to propose a sentence to me during code completion instead of proposing just a word any time. also i want him to give a default name during the proposition of the sentence , instead of waiting for me to enter the name .

Hope is clear now.

Thks in advance

Frank
Re: manage the String type and what is generated from my dsl Grammar [message #897223 is a reply to message #897218] Mon, 23 July 2012 09:27 Go to previous message
Christian Dietrich is currently offline Christian Dietrich
Messages: 6388
Registered: July 2009
Senior Member
Have a look at template proposals

--
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:Resolve JvmOperation
Next Topic:Xtext editors take a long time to open
Goto Forum:
  


Current Time: Sun Oct 26 02:52:15 GMT 2014

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

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