Skip to content

balayette/occ

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

34 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

occ

occ stands for OCaml C Compiler.

What

A C nanopass compiler written in OCaml (for fun). It uses Sedlex, Menhir, and Nanocaml

Features :

  • 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
      • &&
      • ||
      • <=, >=, <, >, ==
      • !=
      • !
      • ~
      • ^
      • &
      • |
      • <<
      • >>
  • 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
      • &&
      • ||
      • <=, >=, <, >, ==
      • !=
      • !
      • ~
      • ^
      • &
      • |
      • <<
      • >>
  • All the unlisted features

Disclaimer

  • 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.

Releases

No releases published

Packages

No packages published

Languages