52 lines
666 B
Markdown
52 lines
666 B
Markdown
|
# MiniC
|
||
|
|
||
|
## Fonctionnalités
|
||
|
|
||
|
* Declaration des types de bases (int, char, float, bool)
|
||
|
* Declaration des fonctions
|
||
|
* Conditions if, else, else if
|
||
|
* Boucle while
|
||
|
* Fonctions natives :
|
||
|
* `_add`
|
||
|
* `_sub`
|
||
|
* `_mul`
|
||
|
* `_div`
|
||
|
* `_add`
|
||
|
* `_sub`
|
||
|
* `_mul`
|
||
|
* `_div`
|
||
|
* `_xor`
|
||
|
* `_or `
|
||
|
* `_and`
|
||
|
* `_seq`
|
||
|
* `_sne`
|
||
|
* `_sge`
|
||
|
* `_sgt`
|
||
|
* `_sle`
|
||
|
* `_slt`
|
||
|
* `_mod`
|
||
|
* `_neg`
|
||
|
* `_not`
|
||
|
* `puts`
|
||
|
* `puti`
|
||
|
* `geti`
|
||
|
|
||
|
## Tests
|
||
|
|
||
|
### Test game (not really)
|
||
|
```sh
|
||
|
$ ocamlbuild -use-menhir test.byte
|
||
|
$ ./test.byte tests/game.test > t.s
|
||
|
$ spim t.s
|
||
|
(spim) load "t.s"
|
||
|
(spim) run
|
||
|
```
|
||
|
|
||
|
### Autres tests (sans user input)
|
||
|
```sh
|
||
|
$ ./build.sh newt
|
||
|
```
|
||
|
```sh
|
||
|
$ ./build.sh puiss
|
||
|
```
|