https://github.com/ziyue-pan/gnc
GNC is Not C. It is intended for a better and more effective c language.
https://github.com/ziyue-pan/gnc
c llvm rust
Last synced: 11 months ago
JSON representation
GNC is Not C. It is intended for a better and more effective c language.
- Host: GitHub
- URL: https://github.com/ziyue-pan/gnc
- Owner: ziyue-pan
- License: mit
- Created: 2021-02-20T07:05:59.000Z (about 5 years ago)
- Default Branch: main
- Last Pushed: 2022-01-15T00:19:10.000Z (about 4 years ago)
- Last Synced: 2024-12-13T13:22:35.705Z (over 1 year ago)
- Topics: c, llvm, rust
- Language: Rust
- Homepage: https://pan-ziyue.github.io/GNC/
- Size: 7.1 MB
- Stars: 18
- Watchers: 0
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# GNC
[](https://github.com/PAN-Ziyue/GNC/actions?workflow=CI)
**GNC** is **N**ot **C**. It is intended for a better and more effective c language.
## Grammar Features
- [x] int main() ...
- [x] declare local int variable
- [x] unary operation
- [x] binary operation
- [x] conditional statement
- [x] loop statement
- [x] scope
- [x] function
- [x] global variable
- [x] more types
- [x] cast expression
- [x] pointer
- [x] string
- [x] `scanf()` and `printf()`
## Other Features
- [x] Pest as frontend
- [x] LLVM as backend
- [x] Parse tree and AST visualization using AntV
- [x] HLVM (High Level Virtual Machine Interpreter)
- [x] Full compiler capabilities in the browser using WASM
## Build
### GNC Cli
```bash
$ cargo build --package GNC --bin GNC
```
### GNC Online
```bash
$ cd forntend
$ yarn
$ yarn build
```
## Test
### Environment
```bash
# install zx
$ npm i -g zx
```
### Run
```bash
$ cd test
$ zx ./minidecaf-test.mjs
```