[ccan] Stlgen perl module generates C code linked list

Greg London email at greglondon.com
Wed Jun 9 23:49:35 EST 2010


I've written a perl module that generates C code.
The idea was to try to create a front end to a perl
module that would allow developers to create
templates of C code and allows users to instantiate
different "classes" of those templates with different
types.

The first template I created is a linked list template.

I tried to follow the naming convention of the C++
Standard Template Library for the linked list container.

Users can then take this module and write a short
perl script which lists what types of data are to
be stored in the linked list. The module then
generates C code for the types requested.

The perl module is available for download here:

http://search.cpan.org/~gslondon/Stlgen-0.012/

It's called "Stlgen" after the Standard Template
Library for C++, except it "gen"erates C code.

It is an alpha version of code, so things are
subject to change.

But since it isn't just plain C code, I can't really
upload it to CCAN. I wasn't sure how exactly to
handle it.

The module itself is separate from the template,
so other designers could add other templates.
For example, a template for a hash could be added,
and the Stlgen.pm module would provide a common
interface for users to instantiate their own code.

Feedback welcome.

Greg






More information about the ccan mailing list