Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Read Program From Memory
Read Program From Memory [message #1404788] Tue, 05 August 2014 18:47 Go to next message
serhat gezgin is currently offline serhat gezginFriend
Messages: 243
Registered: January 2013
Location: Izmir
Senior Member
Hi all,

i create model with emf api as;

Model model = CommandFactory.eINSTANCE.createModel();
		
		USER user = CommandFactory.eINSTANCE.createUSER();
		user.setUser("serhat");
		
		ENC enc = CommandFactory.eINSTANCE.createENC();
		enc.setPass("pass");
		
		model.getCommands().add(user);
		model.getCommands().add(enc);


Now i want strig (program) which fits my grammer from this model. How can i get this ?

i want program which fits my grammer as;

user = serhat ENC{pass}


Regards
Re: Read Program From Memory [message #1404794 is a reply to message #1404788] Tue, 05 August 2014 19:39 Go to previous messageGo to next message
Christian Dietrich is currently online Christian DietrichFriend
Messages: 13280
Registered: July 2009
Senior Member
Hi am not sure if i understand your question. you wan to serialize the model?

you can do something like

Injector i = new MyDslStandlonesetup().createInjectorAndDoEmf....
ISerializer s = i.getInstance(Serializer.class)
s.serialize(model)


Need professional support for Xtext, Xpand, EMF?
Go to: https://www.itemis.com/en/xtext/
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Read Program From Memory [message #1404795 is a reply to message #1404794] Tue, 05 August 2014 19:51 Go to previous messageGo to next message
Christian Dietrich is currently online Christian DietrichFriend
Messages: 13280
Registered: July 2009
Senior Member
or do you mean https://wiki.eclipse.org/Xtext/FAQ#How_do_I_load_my_model_in_a_standalone_Java_application.C2.A0.3F

Need professional support for Xtext, Xpand, EMF?
Go to: https://www.itemis.com/en/xtext/
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Read Program From Memory [message #1415759 is a reply to message #1404795] Wed, 03 September 2014 14:30 Go to previous message
serhat gezgin is currently offline serhat gezginFriend
Messages: 243
Registered: January 2013
Location: Izmir
Senior Member
Yes exactly i mean this;

https://wiki.eclipse.org/Xtext/FAQ#How_do_I_load_my_model_in_a_standalone_Java_application.C2.A0.3F


Thankks for answer and sorry for bad english
Previous Topic:Accessing XText document model in multi tab editor
Next Topic:XTEXT Features with fixed length
Goto Forum:
  


Current Time: Sat Dec 14 16:36:10 GMT 2019

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

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

Back to the top