프로젝트
GitHub에서 보기
vgel/c500
소개
a single pass c compiler in 500 lines of python
프로그래밍 언어 및 런타임측정된 스타 증가
- in 24h
- 0
- in 7 days
- 0
- in 15 days
- 0
- in 1 month
- 기록 수집 중
서로 겹치는 기간의 순증가량이며 일별 합계가 아닙니다. 측정값이 없으면 비워 둡니다. 스타는 관심도를 나타내며 품질을 보장하지 않습니다.
README.md
Originalc500
This is a single-pass C→WebAssembly compiler in 500 lines of (nicely formatted, non-comment, non-docstring) Python:
$ sloccount compiler.py | grep python:
python: 500 (100.00%)
It currently supports:
- Arithmetic
- Pointers
int,char, and string constants (no floating point)if,while,do while,for- Functions
- Typedefs
- (Single dimensional) arrays
- Some other stuff
Notably, it does not support preprocessor directives or structs.
Running code
You can use the ./run-test script to compile and run C code. Simply run ./run-test <c file> after running mkdir scratch.
You'll need bat, wabt, and wasmer installed.
Running tests
You will need to clone the c-testsuite into the repo: https://github.com/c-testsuite/c-testsuite
You'll also need all the tools listed in the Running Code section above.
Then you can ./run-all. It currently passes 34/220 test cases.
관련 프로젝트 살펴보기
불러오는 중…