|
1 | | -# Cnerator |
2 | | - |
3 | | -C code generator |
| 1 | +# Cnerator |
| 2 | + |
| 3 | + |
| 4 | +[](LICENSE) |
| 5 | +[](https://github.com/ComputationalReflection/cnerator/releases) |
| 6 | +<img alt="Python version" src="https://img.shields.io/github/pipenv/locked/python-version/computationalreflection/cnerator"> |
| 7 | +<img alt="Code size" src="https://img.shields.io/github/languages/code-size/computationalreflection/cnerator"> |
| 8 | +<img alt="Repo size" src="https://img.shields.io/github/repo-size/computationalreflection/cnerator"> |
| 9 | + |
| 10 | + |
| 11 | + |
| 12 | +Cnerator is a C source code generation tool. Generated programs can be compiled with any standard ANSI C compiler. |
| 13 | +The user may define different parameters such as the number of function to be generated or the probabilities of all |
| 14 | +the different syntactic constructs (e.g., the average number of statements in a function, expression types, |
| 15 | +number and types of local variables, and the kind of syntactic constructs to be generated). |
| 16 | + |
| 17 | +Generated programs fulfill the type rules of the C programming language, so they are compiled without errors. |
| 18 | +Using the different parameters, the user can utilize Cnerator to create a huge amount of synthetic C programs, |
| 19 | +necessary in common "Big Code" scenarios. |
| 20 | + |
| 21 | +## Command line options: |
| 22 | + |
| 23 | +``` text |
| 24 | +usage: cnerator.py [-h] [-w PATH] [-o NAME] [-p AMOUNT] [-r RECURSION] |
| 25 | + [-vst VISITORS] [-v] [-d] |
| 26 | +
|
| 27 | +Generates a compilable C program |
| 28 | +
|
| 29 | +optional arguments: |
| 30 | + -h, --help show this help message and exit |
| 31 | + -w PATH, --working-dir PATH |
| 32 | + Working directory (default: out) |
| 33 | + -o NAME, --output NAME |
| 34 | + C output file name, without the .c extension (default: |
| 35 | + main) |
| 36 | + -p AMOUNT, --parts AMOUNT |
| 37 | + Split the program in different C files (default: 2) |
| 38 | + -r RECURSION, --recursion RECURSION |
| 39 | + Python recursion limit (default: 50000) |
| 40 | + -vst VISITORS, --visitors VISITORS |
| 41 | + Semicolon-separated list of visitors, in order (e.g., |
| 42 | + visitors.func_to_proc;visitors.return_instrumentation) |
| 43 | + (default: ) |
| 44 | + -v, --verbose Verbose messages (default: False) |
| 45 | + -d, --debug Generate debug info (call graph and struct structure) |
| 46 | + in .dot files (default: False) |
| 47 | +``` |
| 48 | + |
| 49 | + |
| 50 | +## License |
| 51 | + |
| 52 | +[BSD 3 clause license](LICENSE) |
0 commit comments