Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    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 18:08 Go to next message
Bruce Dunn is currently offline Bruce DunnFriend
Messages: 1
Registered: October 2012
Junior Member
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 19:25 Go to previous message
Sebastian Zarnekow is currently offline Sebastian ZarnekowFriend
Messages: 3118
Registered: July 2009
Senior Member
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: Thu Apr 25 09:19:59 GMT 2024

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

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

Back to the top