cyagen

C code based Yet Another GENerator

File generator to reduce the manual effort to prepare another scripting files which contain C code information derived by a C source file.

Better use jinja2 format in template files

Available tags in a template file

Example

``` let sourcename = "source"; let code = "\

include

static int var = 1; static int func1(void) { return 0; } int func2(char c) { return func1(); } "; let temp = "\ // include @incs@@captured@ @end-incs@ // local variables @local-vars@@dtype@ @name@; @end-local-vars@ // functions @fncs@@rtype@ @name@(@args@); @end-fncs@ "; let parser = cyagen::Parser::parse(code); let gen = cyagen::generate(&parser, temp, sourcename); println!("{}", gen); ```

Result

``` // include

include

// local variables int var;

// functions int func1(void); int func2(char c);

```

Default application command line usage

``` $ cyagen --help cyagen 0.1.8 Text file generator based on C file and templates

USAGE: cyagen [OPTIONS] --source

OPTIONS: -s, --source source file path -t, --temp-dir template directory -o, --output-dir output directory -j, --json-filepath output json file path -h, --help Print help information -V, --version Print version information $ ```