Skip to content

ProbablyClem/compiler

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ROO

Rust Object Oriented

  • Rust like syntax
  • Static typing
  • Made for OO
  • Borrow checker

Requirement

  • Linux
  • lcc (LLVM)
  • gcc

Installation

Clone the repos
build with make

usage

$./roo input_file

input_file file being the file to compile.
Then run

$./run.sh

to compile the llvm file into an executable and launch it. The output will be ./a.out

Compiler Architecture

Lexer

scan.c

Convert the code into token.
Throw an error if the lexer don't recognize the input.

Parser

expr.c

Generate an AST from the tokens.
The tree is generated with the token's priority found in OpPrec[].
Thrown an error if the input does't respect the grammar.

tree.c

Utils for generating AST nodes.

stmt.c

Functions trees from statements such as functions or loops.

misc.c

Utils requesting token such as colon().

types.c

Functions managing types compatibilities.

LLVM generator

gen.c

Generate llvm ir code from the AST.

cg.c

Utils for generating llvm code.

Other

main.c

[Entry]
Open and close files and calls other files?

data.h

Expose global variables.

decl.h

Expose public functions.

defs.h

Public Enums

delc.c

Utils for declaring variables or functions.

sym.c

Functions managing the symbols tables.

Ressources

Compiler tutorial : https://github.com/DoctorWkt/acwj
LLVM IR doc : http://llvm.org/docs/LangRef.html
LLVM IR unofficial guide : https://mapping-high-level-constructs-to-llvm-ir.readthedocs.io/en/latest/README.html

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published