[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: CSharp backend



Hi Indrek,

Indrek Mandre wrote:
But I'm not sure Etienne likes the way I did things. He probably
wants his own students to work on important bits like that.

It's not that I do not like the way you did it! It is just that one of my students has been working for some time already on adding a script engine to SableCC's back-end. This script engine does *more* than simply allow targetting new languages; it also allows to generate a variety of other utilities such as new AST walkers and other code based on the grammar, by simply writing a new script without modifying SableCC.

Mainly, your approach is to allow SableCC to instantiate a different
parser generator class for each target language; so this implies that
to target a new language, one has to write a Java class.  Our approach
is to go one step further and free you from having to write any Java
code at all (and from having to undestand SableCC's internal code),
by providing a simple script language which, along with *.txt templates,
generate any new target you want.

What I tried to ask you in my original reply to you (I think I wasn't
clear enough) is: do you agree to license your code under SableCC's license?

In other words:
1- Are you the owner of the code you wrote (or is it your employer/school, if any)?
2- If you are, do you agree to license your code under the LGPL, and allow me to
   make any minor license changes and/or clarification to ensure that:
    a) SableCC remains free (as in freedom),
    b) SableCC's output is not affected by SableCC's license.
   [Mainly, I do not want anybody to claim that any C++ parser generated using your
    code is a derivative of your code and thus should be licensed under the LGPL.  I
    want SableCC users to do whatever they want with the generated output.  So, if
    at any point I need to add a license clarification to make this explicit, I want
    to have the right to do so, if I add your code to SableCC's official source tree.]

In conclusion, I do thank you very much, in advance, for your contribution.  I do not
reject it!  I simply want to integrate it within my student's new framework.


Etienne PS: My understanding of the LGPL is that classes generated using SableCC are simply output, and thus are not subject to any restriction (other that those put by the author of the grammar used to generate these classes). I just want to anticipate any problem if the LGPL was interpreted differently by a SableCC contributor. :-)


The second way would just be to modify the *.txt macro files to generate C# instead of Java. That would probably mostly work because C# syntax is very close to that of Java. But you'll know for sure when you try.

Regards,
Indrek


On Friday 17 October 2003 14:06, RUBIOJR wrote:


Hi,

I'm going to work on a sablecc backend to generate csharp instead of
java and adding the necesary code to sablecc so that the user can choose
the languaje that sablecc generates. After that I want to use the "new"
csharp enabled sablecc to rewrite sablecc in csharp and use it under the
mono platform. Anyway, rewriting it is not a priority.

I've been looking through the SableCC3 Beta2 code and it seems that the
classes that need some work are Gen*.java clases and maybe the
MacroExpander class ( I haven't looked at that one yet ). It seems that
the generated *.txt macros need to be changed too. How did you generated
that macros?

Could someone please show me the right way?
Thanks in advance.

p.s. I'm not a native English speaker, so if you don't get the idea
because of my english skills don't hesitate to ask me, I will try to
explain it better.

Cheers,
Rubio Jr.






--
Etienne M. Gagnon, Ph.D.             http://www.info.uqam.ca/~egagnon/
SableVM:                                       http://www.sablevm.org/
SableCC:                                       http://www.sablecc.org/