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

Re: CSharp backend



On Thursday 23 October 2003 02:33, Etienne Gagnon wrote:
> 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.

I do not belive someone could create a parser generator for
some random language without understanding the details of
what SableCC provides. And different languages have different
requirements that might not be satisfied by simple scripting.

Also my approach does not open up the SableCC internals.
Instead it provides a very clean and neat interface of normalized
data that makes up the parser (tokens, productions, rules, etc).

I did consider for once instead to translate that data to XML and create
different parsers using XSL templates. But I generally don't like
XSLT so I went a slightly different way.

Still. To create a general XML generator from that clean interface
would be a work of couple of hours - it's that simple. You could
use XSLT scripting then. That's your "one step further" - in 2 hours
development time.

Also if one wanted to make a different scripting solution it could
very easily be built on top of my work. Because everything is
neatly available it would be a breeze. Does the world need
yet another scripting language? I'm not sure.

I don't know the details of your student's work but my way is not
limited to targeting other languages. You can target anything
because everything is neatly and cleanly available in one centralised
place.

> 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?

Yes.

> 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.

Excellent. Let the best solution win. Right?

Regards,
Indrek