View previous topic :: View next topic |
Author |
Message |
Abscissa
Joined: 23 Feb 2005 Posts: 40 Location: Cleveland, OH, US
|
Posted: Tue Oct 21, 2008 3:55 pm Post subject: How to use tioport? |
|
|
I am interested in using Tioport to attempt to port ANTLR's StringTemplate from Java to D. I've succeeded in getting the Tioport and dejavu trunks to compile on DMD 1.029 Tango 0.99.6 (untested so far though, and yes, I know those are older versions, I have a complicated reason for sticking with them for the moment, it involves a Tango regex regression that's a blocker for me, etc, not that it matters ). Anyway, DMD gave me some forward reference trouble when using the rakefile, and I'm not too familiar with ruby or rake, so I've resorted to just building/using tioport/dejavu by hand (for now).
The problem now is, I have no idea how to actually use the tioport executable I just built . It seems to want some xml file as an input, and I got the impression that extractmixins.rb is involved somehow (maybe to generate the xml), and I'm able to run extractmixins.rb (but don't know how to actually use that either). Beyond that I'm lost.
Sooo, how do I use this? |
|
Back to top |
|
|
keinfarbton
Joined: 03 Dec 2005 Posts: 224 Location: Stuttgart - Germany
|
Posted: Tue Oct 21, 2008 4:17 pm Post subject: |
|
|
In general you can find such xml files in the swt ports.
translation is done in three steps
1. a java antlr parser translates java to xml. all comments and formating gets lost.
2. tioport translates into D
3. optional apply additions to the generated code.
Nevertheless, i would suggest you not to use tioport and do the port manually. I am doing this for swt and more, so i know what i am talking about. The result is better to maintain and upgrade merges are possible.
There are helper packages in dwt-win and dwt-addons that can assist you with common Java classes and string methods.
See http://www.dsource.org/projects/dwt/wiki/Porting for some hints.
Perhaps ANTLR can be extended to output D code directly. I know there is an API for generating other languages. The amount of Java code in stringtemplates seems not to be so much of work.
In ANTLR emitting D, i would be very interested |
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|