nlsandler/write_a_c_compiler
소개
자신만의 C 컴파일러를 작성하는 데 도움이 되는 테스트 스위트
프로그래밍 언어 및 런타임측정된 스타 증가
- in 24h
- 0
- in 7 days
- 0
- in 15 days
- 0
- in 1 month
- 기록 수집 중
서로 겹치는 기간의 순증가량이며 일별 합계가 아닙니다. 측정값이 없으면 비워 둡니다. 스타는 관심도를 나타내며 품질을 보장하지 않습니다.
README.md
OriginalWrite a C Compiler!
This repo is no longer active. The latest version of this test suite, which accompanies the Writing a C Compiler book, is available here.
This is a set of C test programs to help you write your own compiler. They were written to accompany this tutorial.
Usage
test all
./test_compiler.sh /path/to/your/compiler
test specific stages
To test stage 1 and stage 3,
./test_compiler.sh /path/to/your/compiler 1 3
To test from stage 1 to stage 6,
./test_compiler.sh /path/to/your/compiler `seq 1 6`
In order to use this script, your compiler needs to follow this spec:
It can be invoked from the command line, taking only a C source file as an argument, e.g.:
./YOUR_COMPILER /path/to/program.cWhen passed
program.c, it generates executableprogramin the same directory.It doesn’t generate assembly or an executable if parsing fails (this is what the test script checks for invalid test programs).
The script doesn’t check whether your compiler outputs sensible error messages, but you can use the invalid test programs to test that manually.
Contribute
Additional test cases welcome! You can also file issues here, either about the test suite itself or about the content of the tutorial.
관련 프로젝트 살펴보기
불러오는 중…