Compiler from a subset of C to MIPS in OCaml
Go to file
fiplox 0119a154bf backup 2022-01-27 16:31:58 +01:00
tests backup 2022-01-27 16:31:58 +01:00
.gitignore backup 2022-01-27 16:31:58 +01:00
.merlin backup 2022-01-27 16:31:58 +01:00
README.md backup 2022-01-27 16:31:58 +01:00
ast.ml backup 2022-01-27 16:31:58 +01:00
baselib.ml backup 2022-01-27 16:31:58 +01:00
build.sh backup 2022-01-27 16:31:58 +01:00
compiler.ml backup 2022-01-27 16:31:58 +01:00
lexer.mll backup 2022-01-27 16:31:58 +01:00
mips.ml backup 2022-01-27 16:31:58 +01:00
parser.mly backup 2022-01-27 16:31:58 +01:00
semantics.ml backup 2022-01-27 16:31:58 +01:00
simplifier.ml backup 2022-01-27 16:31:58 +01:00
t.s backup 2022-01-27 16:31:58 +01:00
test.ml backup 2022-01-27 16:31:58 +01:00

README.md

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)

$ 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)

$ ./build.sh newt
$ ./build.sh puiss