occ stands for OCaml C Compiler.
A C nanopass compiler written in OCaml (for fun). It uses Sedlex, Menhir, and Nanocaml
-
Parsing :
- Function declaration
- With parameters
- Variable declaration
- Array declaration
- Variable assignement
- Loops
- While
- For
- Do while
- Conditionals
- if, else, else if
- Ternary
- Var access
- Simple access
- Array access
- Dereference
- Function calls
- Function calls with parameters
- Arithmetic
- Basic operations
- Operator precedance
- Operators
- &&
- ||
- <=, >=, <, >, ==
- !=
- !
- ~
- ^
- &
- |
- <<
- >>
- Function declaration
-
All the unlisted features
-
Compilation
- Function declaration
- With parameters
- Variable declaration
- Array declaration
- Variable assignement
- Loops
- While
- For
- Do while
- Conditionals
- if, else, else if
- Ternary
- Var access
- Simple access
- Array access
- Dereference
- Function calls
- Function calls with parameters
- Arithmetic
- Basic operations
- Operator precedance
- Operators
- &&
- ||
- <=, >=, <, >, ==
- !=
- !
- ~
- ^
- &
- |
- <<
- >>
- Function declaration
-
All the unlisted features
- I know nothing about compiler architecture.
- I know very little about assembly.
- The code is garbage held together by duct tape and the OCaml typesystem.