[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
Re: [xtext-dev] Parsers AND emitters
|
Hi Jay,
Xtend is the natural choice to write template based code generators. Xtext provides an interface IGenerator which templates implement. The main class that implements the interface (it could delegate to others) is bound to the Generator interface in the language’s runtime Guice module. Xtext ships an example from where you can pick some ideas. Install it with "File/New/Example/Xtext State-Machine Example“.
Please note that this mailing list is primarily for communication between Xtext developers. The Xtext forum [1] provides support for you and anyone else for that kind of questions. We are very responsive in the forum, too!
Kind regards, ~Karsten
Hi Jay, good to hear about your successes! and yes, to write the given format you may want to use Xtext’s serializer. It takes an EMF model as input and outputs it as text that fully conforms to your grammar. You can invoke it via org.eclipse.xtext.resource.XtextResource#save(…) or org.eclipse.xtext.serializer.ISerializer If you want to generate text in a format that you don’t have a grammar for, Xtend is an excellent language to implement a mode-to-text transformation aka code generator. regards, Moritz On 10 Aug 2016, at 17:08, Jay Jay Billings <jayjaybillings@xxxxxxxxx> wrote:
Everyone,
We have had some really great success deploying xtext for processing 3D geometry formats in Eclipse ICE, which is work that Kasper Gammeltoft did over the summer. It greatly accelerated our pace when it comes to parsing these files, but is there anything that it can do to help us with writing emitters? That is, can it generate routines to programmatically write to the given format as well?
We haven't been able to find anything in various tutorials about it.
Thanks, Jay
-- Jay Jay Billings Oak Ridge National Laboratory Twitter Handle: @jayjaybillings _______________________________________________ xtext-dev mailing list xtext-dev@xxxxxxxxxxx To change your delivery options, retrieve your password, or unsubscribe from this list, visit https://dev.eclipse.org/mailman/listinfo/xtext-dev
_______________________________________________ xtext-dev mailing list xtext-dev@xxxxxxxxxxxTo change your delivery options, retrieve your password, or unsubscribe from this list, visit https://dev.eclipse.org/mailman/listinfo/xtext-dev
|
Attachment:
signature.asc
Description: Message signed with OpenPGP using GPGMail