|Re: Reading the .mydsl file [message #897638 is a reply to message #897460]
||Tue, 24 July 2012 20:39
| Henrik Lindberg
Registered: July 2009
On 2012-24-07 10:19, Robert Breunung wrote:|
> I want to parse a file with instructions of my DSL. I read the tutorial
> on the homepage and the documentation and I got a basic idea how to
> design the language. In the editor it worked all fine as described.
> Now my scenario is: I have the basic mydsl, after starting a new
> project. I saved the "Hello World!" in that language into a file
> "hello.mydsl". I want to use the DSL in my own RCP App.
> What do I have to do, to read the content of the file? How do I get the
> EMF representation?
1. You install (include the bundles for) your dsl along with xtext, emf,
etc. in your RCP application. Does your .mydsl depend on JDT (does it
just the java model in any way - classpath resolution of resources,
types, etc.)? If so, you need to include JDT.
2. You simply use EMF to open a .myDSL file (a Resource) - this will
trigger the parser and produce an EMF Resource with an EMF model.
Question somewhat unclear depending on what is in your RCP application,
and you want to allow users to do. Edit .mydsl files? Do you plan to
ship some .mydsl files as some sort of library that they are supposed to
just read/use in the form of a model? Do you want to generate things
from .mydsl and use that instead in the RCP?
Hope the general answer helps though.
Powered by FUDForum
. Page generated in 0.01911 seconds