Reading the .mydsl file [message #897460] |
Tue, 24 July 2012 04:19  |
Eclipse User |
|
|
|
Hello,
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?
Sincerely
Robert
|
|
|
|
Re: Reading the .mydsl file [message #897638 is a reply to message #897460] |
Tue, 24 July 2012 16:39   |
Eclipse User |
|
|
|
On 2012-24-07 10:19, Robert Breunung wrote:
> Hello,
>
> 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?
etc.
Hope the general answer helps though.
- henrik
|
|
|
Re: Reading the .mydsl file [message #897692 is a reply to message #897638] |
Wed, 25 July 2012 02:38  |
Eclipse User |
|
|
|
Hello,
thanks for your hints. I will try your hints on next opportunity.
My intention is, to ship in my RCP application a minimal arithmetic language. I want to express a list of rules with the language, to aggregate some vales. This language should be used by the user of the application to configure the result.
Robert
|
|
|
Powered by
FUDForum. Page generated in 0.46580 seconds