-- The DemFGen Manual is in a working Draft state. Last updated Aug. 28th 2008. I'll add more as I get a chance.
-- DGP functions (Display/ToStr/Print) are now fixed for C# generic classes.
Here's a more complicated example of a simple Compiler written using DemFGen
A few interesting files:
program.cd.dfg : The DemFGen CD file, for DemFGen
demfgen.png : An image of the class graph, generated with DemFGen and GraphvisDescription:
DemFGen is a data binding and class/parser generation tool for Java. 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 DemeterF. See Documents below for the user manual and examples
DemFGen/DemFGenCS are part of the DemeterF Java release and does not require any other libraries. It can be run with java DemFGen if the jars are in your classpath. It generates a parser definition/input for JavaCC.
The same library also supports C# class/parser generation using the DemFGenCS main class. It generates a parser definition/input for CSJavaCC (JavaCC modified for C# parser generation). It has been tested using the Mono gmcs compiler on Linux.Features include:
- Support for Java/C# Generics and Parser generation for parameterized classes
- Modularity support for "includes" in CD and BEH files
- External Library support (plus parsing) with nogen class option
- Plugable data-generic programming support with traversals.
- Built-in generic Print, ToString, and Display function generation (the DemeterF analogue of DemeterJ generated visitors)
- Cleaner code generation, simpler syntax
Documents:
The library and source are part of the DemeterF Java release. Run "java DemFGen --help" to get full usage for the command, also see Here for how I use it to generate its own files (part of the DemeterF source)
Using DemFGenCS for C# generated classes also requires DemeterF.dll to build, but there is a "--windows" option to choose between Cygwin/GMCS and CMD/csc on Windows systems. See CSJavaCC for C# parser generation from DemFGenCS 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...