Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/magetron/c-interpreter
Patrick's C Compiler (interpreter)
https://github.com/magetron/c-interpreter
compiler interpreter pcc
Last synced: 3 months ago
JSON representation
Patrick's C Compiler (interpreter)
- Host: GitHub
- URL: https://github.com/magetron/c-interpreter
- Owner: magetron
- License: mit
- Created: 2018-12-22T01:30:03.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2019-06-12T14:08:51.000Z (over 5 years ago)
- Last Synced: 2024-04-24T15:34:27.887Z (9 months ago)
- Topics: compiler, interpreter, pcc
- Language: C
- Size: 58.6 KB
- Stars: 19
- Watchers: 5
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- AwesomeInterpreter - c-interpreter
README
# c-interpreter
This is a small project where I try to make a C minimal interpreter in 10 days.
It's called Patrick's C compiler -> pcc.
## Files
* `pcc.c` - The source code of pcc.
* `hello.c` - A piece of testing C code that outputs `Hello World!\n`
* `fibonacci.c` - A piece of testing C code that outputs fibonacci sequence using recursion.
## Usage
`gcc -m32 pcc.c -o pcc`
`-m32` tag is used for `64-bit` machines.
`./pcc hello.c`
### Bootstrap
pcc is a interepter that bootstraps. Therefore, feel free to execute commands like :
`./pcc pcc.c fibonacci.c`
Although it is not recommended since this slows down the program for no reason.
### Options
`./pcc -s` outputs ASM code for VM / Further compiler purposes.
`./pcc -d` outputs DEBUG information.