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

RE: [Sablecc-user] Re: CSharp backend



Hello all,
  I've recently started using sablecc. I just wanted to say
good job. This project was exactly what I was looking for.
When I was looking for parser/lexer tools. I was always
wondering why the parsers/lexers were always in different projects.
And when i was looking at them. if you have the same grammar
and u wanted to write say a interperter and a compiler. What
are you to do.. copy and paste the grammar!!! Well then i found your project
awesome job! Anyways... just to clearify, Inderk implemented the
outstanding feature of outputting different languages? That
is awesome. Is this going to be put in the main cvs tree?

  - Brad


-----Original Message-----
From: Indrek Mandre [mailto:indrek@mare.ee]
Sent: Sunday, October 26, 2003 8:58 AM
To: Etienne Gagnon
Cc: sablecc-list@sable.mcgill.ca; sablecc-user@lists.sourceforge.net
Subject: Re: [Sablecc-user] Re: CSharp backend



I've updated the xml generator as it was missing token state
transitions. Also I changed the naming of tags to be
more consistent. Still I was guessing here and there
(the data tables namings).

http://www.mare.ee/indrek/sablecc/xml4sablecc-0.1b.tar.gz

As a second thing I explored more into XML processing. Read
couple of books on it etc :) I finally started writing an XSLT
script to test it out. As I went along it I discovered that it's
really simple and wrote a whole set of transformations to
create an entire java based parser. The produced parser
should be exactly the same as SableCC natively generates
except for the .dat files where I had to innovate a bit.

It uses Apache xalan and its extensions together with Mozilla
ECMAscript. To run it you need xalan.jar and bsf.jar from xalan
archive and js.jar from Mozilla project. I've also bundled them
with the archive (3MB).

http://www.mare.ee/indrek/sablecc/java4sablecc-0.1.tar.gz

I think XML/XSLT is the best solution for extending sablecc
as it's all Java (platform independent, user doesn't have to
install anything) and very standardised. Also it can be
extended using either JavaScript or even Java if needed.

The slight downside is that XSL is tuned more towards
producing xml out of xml and the syntax could be a bit
shorter/cleaner.

There are 10-s of templating/code generation tools out there
that could alternatively be used.

Regards,
Indrek


On Saturday 25 October 2003 02:00, Indrek Mandre wrote:
> Here's all the code for the public eyes now:
>
> the patch for sablecc3:
> http://www.mare.ee/indrek/sablecc/altgen.tar.gz
>
> the xml generator:
> http://www.mare.ee/indrek/sablecc/xml4sablecc-0.1a.tar.gz
>
> the c++ generator:
> http://www.mare.ee/indrek/sablecc/cxx4sablecc-0.1a.tar.gz
>
> Regards,
> Indrek
>
> On Friday 24 October 2003 16:20, Etienne Gagnon wrote:
> > Roger Keays wrote:
> > > Just picked up on this thread....
> > >
> > > We can still add Indrek's patches to the downloads page on the website
> > > right? I suppose this would depend on the license?
> >
> > He agreed in his message to license his code under SableCC's license, so
> > I see no problem with that.  In fact, I think it would be a good idea to
> > eventually add this code in the Subversion repository.
> >
> > I will suggest to my student to look whether using Indrek's
modifications
> > as a basis for coupling his scripting engine to SableCC would be
> > appropriate.
> >
> > Maybe we will be able to prove Indrek wrong by showing that a little
> > script language would make code generation much simpler to read and more
> > maintainable than coding it in Java... :-)
> >
> > Etienne
>
> -------------------------------------------------------
> This SF.net email is sponsored by: The SF.net Donation Program.
> Do you like what SourceForge.net is doing for the Open
> Source Community?  Make a contribution, and help us add new
> features and functionality. Click here: http://sourceforge.net/donate/
> _______________________________________________
> Sablecc-user mailing list
> Sablecc-user@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/sablecc-user



-------------------------------------------------------
This SF.net email is sponsored by: The SF.net Donation Program.
Do you like what SourceForge.net is doing for the Open
Source Community?  Make a contribution, and help us add new
features and functionality. Click here: http://sourceforge.net/donate/
_______________________________________________
Sablecc-user mailing list
Sablecc-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sablecc-user