How do I create Java & Python parsers for the same Xtext DSL [message #946993] |
Tue, 16 October 2012 14:08  |
Eclipse User |
|
|
|
I'm looking at using Xtext to define a DSL for a language who's input files are dynamically loaded at runtime by both a Java application and a Python application. That is, I need Xtext to generate both Java and Python lexers/parsers for my language so I can embed them in my two applications.
I've been poking around the .mwe2 workflow file and it appears that it has the ability to support multiple language elements within the Generator component, but I can't figure out how to do it. Am I on the right path or am I off in the weeds?
Any help would be appreciated.
|
|
|
Re: How do I create Java & Python parsers for the same Xtext DSL [message #947057 is a reply to message #946993] |
Tue, 16 October 2012 15:25  |
Eclipse User |
|
|
|
Hi Bruce,
you'll have to implement an IGeneratorFragment that produces the lexer
for the Python app.
You probably want to extend
org.eclipse.xtext.generator.AbstractGeneratorFragment or
org.eclipse.xtext.generator.Xtend2GeneratorFragment
Hope that helps,
Sebastian
--
Looking for professional support for Xtext, Xtend or Eclipse Modeling?
Go visit: http://xtext.itemis.com
Am 16.10.12 21:09, schrieb Bruce Dunn:
> I'm looking at using Xtext to define a DSL for a language who's input
> files are dynamically loaded at runtime by both a Java application and a
> Python application. That is, I need Xtext to generate both Java and
> Python lexers/parsers for my language so I can embed them in my two
> applications.
>
> I've been poking around the .mwe2 workflow file and it appears that it
> has the ability to support multiple language elements within the
> Generator component, but I can't figure out how to do it. Am I on the
> right path or am I off in the weeds?
>
> Any help would be appreciated.
>
|
|
|
Powered by
FUDForum. Page generated in 0.26630 seconds