Skip to content

Commit 27abb33

Browse files
New readme
1 parent 9649154 commit 27abb33

File tree

4 files changed

+92
-9
lines changed

4 files changed

+92
-9
lines changed

LICENSE

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
BSD 3-Clause License
2+
3+
Copyright (c) 2020, Computational Reflection
4+
All rights reserved.
5+
6+
Redistribution and use in source and binary forms, with or without
7+
modification, are permitted provided that the following conditions are met:
8+
9+
1. Redistributions of source code must retain the above copyright notice, this
10+
list of conditions and the following disclaimer.
11+
12+
2. Redistributions in binary form must reproduce the above copyright notice,
13+
this list of conditions and the following disclaimer in the documentation
14+
and/or other materials provided with the distribution.
15+
16+
3. Neither the name of the copyright holder nor the names of its
17+
contributors may be used to endorse or promote products derived from
18+
this software without specific prior written permission.
19+
20+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21+
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
23+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
24+
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25+
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
26+
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
27+
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
28+
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
29+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

README.md

Lines changed: 52 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,52 @@
1-
# Cnerator
2-
3-
C code generator
1+
# Cnerator
2+
3+
4+
[![License](https://img.shields.io/github/license/ComputationalReflection/cnerator)](LICENSE)
5+
[![Latest stable release](https://img.shields.io/github/v/release/ComputationalReflection/cnerator?label=current-version)](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)
File renamed without changes.

setup.py

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,34 +19,39 @@
1919
__version = "0.1.0"
2020
__maintainer = __contacts[0][0]
2121
__email = __contacts[0][1]
22-
__contact =__email
22+
__contact = __email
2323
__status = "Alpha"
2424
__url = "https://github.com/Kerrigan29a/cnerator"
2525

2626

2727
def read_lines(file_name):
2828
file = open(os.path.join(os.path.dirname(__file__), file_name))
29-
lines = "".join(file.readlines())
29+
lines = file.readlines()
3030
file.close()
3131
return lines
3232

3333

34+
def read_file(file_name):
35+
lines = read_lines(file_name)
36+
return "".join(lines)
37+
38+
3439
setup(
3540
name='cnerator',
3641
version=__version,
3742
description='C source code generator',
38-
long_description=read_lines("README.md"),
39-
long_description_content_type = "text/markdown",
43+
long_description=read_file("README.md"),
44+
long_description_content_type="text/markdown",
4045
author=__author,
4146
author_email=__email,
4247
maintainer=__maintainer,
4348
maintainer_email=__email,
4449
url=__url,
4550
download_url=__url,
4651
license=__license,
47-
keywords="c clang code generator",
52+
keywords="C language lang code generator",
4853
install_requires=read_lines("requirements.txt"),
49-
# dependency_links=[],
54+
#dependency_links=['singledispatch'],
5055
packages=find_packages(),
5156
platforms='any',
5257
classifiers=[

0 commit comments

Comments
 (0)