I have been using Sable 3.x for several years and absolutely love it! We have been able to build a very complicated language in an amazingly short time!
I now would like to something different, and am not sure if it can be done....
We have a need to build a translator from one “language” to several others. We have some testing processes written in a (simple) generic language similar to a “pseudo code”, and I want to build a translator that will interpret that “pseudo language” and then output the result in several different languages (python, Java, MATLAB, etc...)
Building the interpreter for the pseudo code I think I can do fairly easily. What I need some ideas on is how to write the translator so that I can add/remove target languages without modifying the translator/interpreter code. I feel like I should be able to do something like what is done with SableCC in that it generates the parser in an “macro” form and you can output the parser in java, c, whatever by using different macro text files that define the output form. But in this case I don’t want the parser in several languages, rather I want that macro approach for the translator output.
I’m just wondering if I am way off base in thinking that this should be pretty simple ... but I’m not sure how exactly to hook it all up. I would prefer to have a solution that can be used in the SableCC 3.x environment (just because all of my other tools are still on that), but if 4.x is a better choice, I’m willing to use it (my understanding so far is that 4.x is not quite “ready for prime time” but some parts of it may be??)
Thanks
Roger
You can use Eclipse ecore to generate your intermediate language, but in my opinion it has to many dependencies and if you (or your client) are not going to use Eclipse, it has no sense to add tens of megabytes of libraries only to generate simple POJOs that you can create by hand.
You could use SableCC to translate your "pseudo code" into XML and then use XSL to translate the XML into any number of target languages.
--
-- You received this message because you are subscribed to the SableCC group. To post to this group, send email to sab...@googlegroups.com. To unsubscribe from this group, send email to sablecc+u...@googlegroups.com. For more options, visit this group at https://groups.google.com/d/forum/sablecc?hl=en
---
You received this message because you are subscribed to the Google Groups "SableCC" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sablecc+u...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
class <% modelObject.name %> : super_class {
class <% xmlObject.getAttribute("name") %> : super_class {