https://github.com/romch007/chadinterpreter
Custom language interpreter
https://github.com/romch007/chadinterpreter
c interpreter language
Last synced: 27 days ago
JSON representation
Custom language interpreter
- Host: GitHub
- URL: https://github.com/romch007/chadinterpreter
- Owner: romch007
- License: gpl-3.0
- Created: 2023-09-30T08:48:51.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2024-04-14T17:08:52.000Z (about 2 years ago)
- Last Synced: 2025-01-11T19:44:30.377Z (over 1 year ago)
- Topics: c, interpreter, language
- Language: C
- Homepage:
- Size: 260 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Custom language interpreter in C
Configure and build:
```bash
cmake -S . -B build
cmake --build build --parallel
```
## Features
- [x] Variables
- [x] Types (`str`, `bool`, `int`, `float`, `null`)
- [x] Flow control (`if`, `else if`, `else`, `while`)
- [x] Reference counted strings
- [x] Functions
## How to use the language
Variable declarations:
```
const title = "Hello World!";
let i = 0;
let truth = false;
let null_for_the_moment;
```
Flow control:
```
let i = 8;
if (i < 7) {
i = 0;
} else if (i == 8) {
i += 1;
} else {
i = -12;
}
while (i < 100) {
i += 1;
}
```
Functions:
```
fn add(a, b) {
return a + b;
}
```