c2lang/c2compiler
c2lang/c2compiler has 841 GitHub stars and 56 forks. GitHot measured 0 stars in 24 hours and 0 in 7 days. Last checked 2026-11-22 00:19 UTC. Last push 2026-11-07.
实测星标增长
- 24小时
- 0
- 7天
- 0
- 15天
- 正在收集历史
- 1个月
- 正在收集历史
各周期内的星标净变化,周期相互重叠,并非每日新增。缺失的测量保持空白。星标代表关注度,不代表软件质量。
关于
the c2 programming language
开发工具README.md
原文C2Compiler - Native version
This is the C2 compiler written in C2 itself.
C2 is an evolution of C, please see http://c2lang.org for more info.
The first version was written in C++ and can be found in the history of this archive too.
Installation
see the installation document for installation on Linux or OSX.
Libraries
c2c needs 2 environment variables:
- C2_LIBDIR - where to find the library headers
- C2_PLUGINDIR - where to find the compiled c2c plugins
The C2_LIBDIR should point to <path_to_c2compiler>/libs The C2_PLUGINDIR may be anywhere and is used by the install_plugins.sh script
All these variables may contain multiple paths, separated by colons (:)
Bootstrap
Since c2c is written in C2, a bootstrap is needed. Please run
. ./env.sh
make -C bootstrap
./install_plugins.sh
This will create a boostrap c2c version and use it to build the c2c compiler. The output will be in the folder output/
Now you can run the regular C2 compiler to compile (other) C2 projects
./output/c2c/c2c
A nicer way would be to create a symlink in ~/bin:
ln -s <path_to_c2compiler>/output/c2c/c2c ~/bin/c2c
Also make sure ~/bin is in your PATH variable
Plugins
The C2 compiler has a plugin system, that allows plugins to be loaded during compilation and the AST to be modified by them.
c2c will look for plugins in the environment variable $C2_PLUGINDIR (set by the env.sh script). Also the path can be set in the build-file. To install the plugins initially, run ./install_plugins.sh. This will create ~/c2_plugins/ and copy all plugins there.
To run c2c without plugins, use --noplugins.
Tests
To run the unit tests run
./output/tester/tester test
探索相关项目
加载中…