https://github.com/zenhack/c-ast
GNU Guile library for generating/outputing ANSI C ASTs.
https://github.com/zenhack/c-ast
Last synced: 9 months ago
JSON representation
GNU Guile library for generating/outputing ANSI C ASTs.
- Host: GitHub
- URL: https://github.com/zenhack/c-ast
- Owner: zenhack
- License: gpl-3.0
- Created: 2014-10-16T03:57:54.000Z (about 11 years ago)
- Default Branch: master
- Last Pushed: 2014-12-05T02:10:34.000Z (about 11 years ago)
- Last Synced: 2025-02-03T13:45:06.973Z (11 months ago)
- Language: Scheme
- Size: 227 KB
- Stars: 6
- Watchers: 2
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: COPYING
Awesome Lists containing this project
README
C-Ast is a GNU Guile library for generating C code. There are some
examples in the example directory, but briefly, it lets you turn
s-expresions like:
(for ((= i 0) (< i limit) (+= i 1))
(call printf "i = %d\n" i))
Into C source code:
for (i = 0; i < limit; i += 1) {
printf("i = %d\n", i);
}
...which can then be fed through a C compiler.
This is interesting because it allows use of scheme to easily manipulate
C programs -- many the same benefits of a proper lisp-style macro system
can be used to write low-level code.
The intention is for this to be a building block for building other
tools.
C-Ast is still in a *very* early stage of development -- you can write
hello world, but it's missing a lot of important features and some
documentation, and probably isn't packaged the way a guile library
should be -- I'm still very new to the language.
# Requirements
To run the test suite, you will need an implementation of srfi-64. The
one I use is: .