title: How can I create an EMF model instance in Java
body: <p>I have a meta model in EMF for a programming language, say X. I know that we can generate model instances conforming to the meta-model, as described here: <a href="http://eclipse.org/epsilon/doc/articles/reflective-emf-tutorial/" rel="nofollow">http://eclipse.org/epsilon/doc/articles/reflective-emf-tutorial/</a></p>
  
  <p>However, suppose I have a small program written in the language X . How can I generate an EMF model instance for this program? To be more precise, I want a function, to which, I give the program file(say HelloWorld.X) as an argument and it returns the emf model for that program. What I have done so far is that I have written a class in Java which can extract all the different types and elements from HelloWorld.X. This was possible because the meta-model of the language X had some methods like getXYZtype() and so on. However,the problem is that I am not able to understand how to generate the emf model, once I have extracted all the types and instances from the program. 
  Could someone please guide me in this direction.</p>
  
  <p>Looking forward to a reply,
  Thank you so much!!!   </p>