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

Re: [Sablecc-user] new SableCC.altgen.20040110 release



The altgen system is excellent, and I hope it gets integrated with the
main source tree soon.

In my research, I've needed to write an O'Caml backend for SableCC.
Here's the diff.

http://plam.lcs.mit.edu/ocaml-sablecc3-diffs

Here's the readme:

This backend generates a set of O'Caml files which parse the input
specification.  The analysis framework is significantly different from
the one generated in the SableCC backend, because nodes are completely
functional in the parser generated by this backend; the approach is
modelled on Polyglot's tree implementation.  See utils.xss for two
examples of using visitors (no modifications in these visitors,
though).

The interface for extracting data from specific nodes is still a bit
more verbose than it needs to be, but I don't yet know how to make it
better.  Ideally, it would also be possible to restrict the use of
`option' to cases in the CST where the ? operator was used.

I use this command to compile testparser.ml:

ocamlc -I +lablgtk2 -w s lablgtk.cma gtkInit.cmo parserdat.ml lexerdat.ml
tokens.ml nodes.ml lexer.mli lexer.ml parser.mli parser.ml analysis.mli
analysis.ml ../testparser.ml

lablgtk2 is required to compile testparser.ml.

This code is licensed under the Lesser General Public License, and
generated code may be used under any license.

January 14, 2004
Patrick Lam


On Sat, 10 Jan 2004, Indrek Mandre wrote:

>
> Alternative generation system allows SableCC to target other
> languages besides Java, for example C++ and C#.
>
> I've released a new version of the alternative generation system.
> This release is long overdue, as most changes were done a month ago.
>
> This is not an official sablecc release. This is experimental stuff.
> You've been warned :)
>
> The binary&source distribution is avilable from my homepage:
> 	http://www.mare.ee/indrek/sablecc/
> and also from the SableCC subversion repository:
> 	svn://svn.sablecc.org/developers/indrek/sandbox/sablecc-indrek/
>
> Supported languages:
>  - java, C++, C#, XML and graphviz's dot formated files of the AST.
>
> News:
>  - there are no more multiple packages
>  - everything is integrated into one sablecc package and my source branch
>  - no more dependencies on XSL or Apache Xalan
>  - XSS has now a stand alone interpreter
>  - no more EcmaScript support inside the XSS
>  - xss templates come with the archive, java, c++, c# and others
>  - generation syntax changed, now options on the sablecc binary
>  - XML structure was changed a bit, some element names were changed
>    also many additional properties to make C++ generation simpler without
>    the use of EcmaScript
>  - sablecc does not generate anymore anything in the native mode,
>    only outputs xss based files
>  - caching of analyzed parser data for fast generation: useful for
>    xss development
>
> Also see the attached README.altgen.txt
>
> This release contains lots of changes. So if anything does not work for
> you please let me know.
>
> Regards,
> Indrek
>