|
|
Re: Dynamic loading of files conforming to arbitrary DSLs [message #512022 is a reply to message #511676] |
Wed, 03 February 2010 16:45 |
Christoph Elsner Messages: 5 Registered: February 2010 |
Junior Member |
|
|
Hi Sven,
thanks for your reply. It's good to know that I do not have to generate an API for the metamodel.
My question was meant in an even more general (and maybe more naive) sense:
Is it possible to parse a file conforming to a XText DSL without generating any file at all (no grammar, no <Lang>RuntimeModule.java, no <Lang>StandaloneSetup.java, no Internal<Lang>Parser.java ...)
This would be a kind of "dynamic" parser then, which *interprets* the XText grammar instead of generating java/ANTLR code for parsing.
However, as I've seen now both ANTLR and the new XText alternative are "parser generators", not "grammar interpreters". So, finally, it seems I won't get around running a parser generator and jump into the generated code via reflection. Do you think so as well?
Cheers,
Christoph
Sven Efftinge wrote on Tue, 02 February 2010 04:12 | Xtext can work with dynamic emf models.
However, there are some generated convenience classes (e.g.
ProposalProvider) which refer to the generated Java clases.
But those components are not mandatory.
Sven
|
|
|
|
Re: Dynamic loading of files conforming to arbitrary DSLs [message #512163 is a reply to message #512022] |
Thu, 04 February 2010 04:32 |
Sven Efftinge Messages: 1823 Registered: July 2009 |
Senior Member |
|
|
Christoph Elsner schrieb:
> Hi Sven,
>
> thanks for your reply. It's good to know that I do not have to generate
> an API for the metamodel.
>
> My question was meant in an even more general (and maybe more naive) sense:
> Is it possible to parse a file conforming to a XText DSL without
> generating any file at all (no grammar, no <Lang>RuntimeModule.java, no
> <Lang>StandaloneSetup.java, no Internal<Lang>Parser.java ...)
>
> This would be a kind of "dynamic" parser then, which *interprets* the
> XText grammar instead of generating java/ANTLR code for parsing.
>
> However, as I've seen now both ANTLR and the new XText alternative are
> "parser generators", not "grammar interpreters". So, finally, it seems I
> won't get around running a parser generator and jump into the generated
> code via reflection. Do you think so as well?
Yes, those components are generated.
You could generate and compile at runtime and load the generated code
via URLClassLoader. But I don't know how well that would perform.
Sven
--
Need professional support for Xtext and EMF?
Go to: http://xtext.itemis.com
Twitter : @svenefftinge
Blog : blog.efftinge.de
|
|
|
Powered by
FUDForum. Page generated in 0.03052 seconds