Skip to main content



      Home
Home » Modeling » TMF (Xtext) » How do I create Java & Python parsers for the same Xtext DSL
How do I create Java & Python parsers for the same Xtext DSL [message #946993] Tue, 16 October 2012 14:08 Go to next message
Eclipse UserFriend
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 Go to previous message
Eclipse UserFriend
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.
>
Previous Topic:Finding referencing objects
Next Topic:Modifying the default grammar
Goto Forum:
  


Current Time: Tue Jul 08 15:42:35 EDT 2025

Powered by FUDForum. Page generated in 0.26630 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top