Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/nim-lang/c2nim
c2nim is a tool to translate Ansi C code to Nim. The output is human-readable Nim code that is meant to be tweaked by hand before and after the translation process.
https://github.com/nim-lang/c2nim
Last synced: 2 months ago
JSON representation
c2nim is a tool to translate Ansi C code to Nim. The output is human-readable Nim code that is meant to be tweaked by hand before and after the translation process.
- Host: GitHub
- URL: https://github.com/nim-lang/c2nim
- Owner: nim-lang
- License: mit
- Created: 2014-06-28T11:29:53.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2023-11-07T11:18:37.000Z (about 1 year ago)
- Last Synced: 2024-08-01T19:56:26.089Z (5 months ago)
- Language: Nim
- Homepage:
- Size: 448 KB
- Stars: 502
- Watchers: 30
- Forks: 63
- Open Issues: 42
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
- awesome-nim - c2nim - c2nim is a tool to translate Ansi C code to Nim. (Development Tools / Binding Generators)
README
c2nim
=====c2nim is a tool to translate ANSI C code to Nim. The output is human-readable
Nim code that is meant to be tweaked by hand after the translation process.
c2nim is no real compiler!Please see the manual [here](doc/c2nim.rst).
Installing
----------Run `nimble install c2nim`.
Translating
-----------c2nim is preliminary meant to translate C header files. Because of this, the
preprocessor is part of the parser. For example:```C
#define abc 123
#define xyz 789
```Is translated into:
```Nim
const
abc* = 123
xyz* = 789
```c2nim is meant to translate fragments of C/C++ code and thus does not follow
include files. c2nim cannot parse all of ANSI C/C++ and many constructs cannot
be represented in Nim.