NOTE: This program has been improved and updated for recent Haskell versions.
It is now called java-adt
and can be installed with a recent Haskell platform via
cabal install alex happy java-adtThe new project homepage is https://github.com/andreasabel/java-adt.
Functional algebraic data types can be simulated using immutable Java classes. Such data types are neat for representing abstract syntax, e.g., as in Andrew Appel's, Modern Compiler Implementation in Java. This little Haskell program parses a Haskell data declaration and outputs a number of Java class files which implement this data type.
New features:
dataGen --defaultVisitor straightLine.hsor
dataGen customVisitorsStraightLine.hsor
dataGen --defaultVisitor MJAbsSyn.hsThis will generate a bunch of .java files.
Example: straightLine.tar.gz a functional interpreter for the straight line programming language (Appel, Chapter 1), written with dataGen.
Good luck!
Andreas Abel,
http://www.tcs.informatik.uni-muenchen.de/~abel
Last modified: Tue Oct 25 17:14:26 CEST 2005 |