The DemeterF Class Generator (demfgen)

Description, Usage and Examples



-- The DemeterF ClassGen Manual is in a working Draft state. Last updated Jan. 8th 2009. I'll add more as I get a chance.

-- Here's a more complicated example of a simple Compiler written using DemeterF

A few interesting files:

demfgen.cd : The DemeterF CD file, for DemeterF
demfgen.png : An image of the class graph, generated with DemeterF and Graphvis

Description:

demfgen is a data binding and class/parser generation tool for Java which is part of DemeterF. demfgenCS is the same tool with C# output. Both use Class Dictionary and Behavior file syntax similar to DemeterJ, adding many new features, with specific support for more functional style OO programming using the DemeterF traversal library. See Documents below for the user manual and examples

DemFGen/DemFGenCS are part of the DemeterF Java release and do not require any other libraries. Each can be run with java demeterf (and likewise java demeterfcs) when the jars are in the current classpath. By default they generate parser definition input for JavaCC.

Using the C# version (demeterfcs) generates a parser definition/input for CSJavaCC, our local port of JavaCC modified for to generate C# parsers. Generated classes have been tested using the Mono gmcs compiler on Linux, and with the Microsoft C# compiler (csc) on Windows.

Features include:

Documents:

The library and source are part of the DemeterF Java release. Run "java demeterf --help" to get full usage for the command, also see Here for how I use it to generate its own files (part of the browsable DemeterF source)

Using demeterfcs and cimpiling C# generated classes requires our C# library (DemeterF.dll), but the option "--windows" can be used to choose between Cygwin/GMCS and CMD/csc on Windows systems (As far as we know it should be compatible with futer versions). See CSJavaCC for C# parser generation from demeterfcs output.

I am currently working on a usage document (draft) that describes the tool's arguments and input file syntax. Comments are welcome.

An Examples page is soon to come...