GitXplorerGitXplorer
a

c2bf

public
220 stars
12 forks
3 issues

Commits

List of commits on branch master.
Verified
738c0759c9d77ed2c3cbb754e4a55dade8096395

Merge pull request #8 from omerien/master

aarthaud committed 2 years ago
Verified
a167a766f8434f6b2ef4c9e355495cf4c0a039f4

Update README.md

oomerien committed 2 years ago
Verified
e4e76604483483dcbec3c7a0f9a3defcc6480cd8

Add installation instructions for Ubuntu

aarthaud committed 4 years ago
Unverified
b10abcb16a04847b7fe7b681d525c5dc51c254f1

Add XOR

aarthaud committed 10 years ago
Unverified
826cff66facf1d0548e0bc43ac7756c81b836841

Add an example : a brainfuck compiler

aarthaud committed 10 years ago
Unverified
a3235b1f8ecf6a2ff6836f802cefa02802eb8f0f

Fix: using arrays as arguments for functions

aarthaud committed 10 years ago

README

The README file for this repository.

c2bf

c2bf is a compiler from a subset of C to brainfuck.

Dependencies

You will need ocamlbuild and ocamlfind.

Ubuntu

To install the dependencies on Ubuntu, run the following commands:

$ sudo apt install opam ocamlbuild
$ opam init
$ eval $(opam config env)
$ opam install ocamlfind

macOS

To install the dependencies on macOS, run the following commands:

$ brew install ocaml ocamlbuild ocaml-findlib

Build

Just run make build to build c2bf.

How to use

usage: ./c2bf.native [options] <C source-file>. The brainfuck output is in a.bf.

I recommend you beef http://kiyuko.org/software/beef as a brainfuck interpreter.

See ./c2bf.native --help for options.

Examples

There are examples in the directory tests. You should try them !

Why ? This is useless !

Because it's fun, and I like having fun.