Skip to content

an unfinished compiler project started during my 2nd in uni

Notifications You must be signed in to change notification settings

S-V/basya-compiler

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

basya-compiler

A primitive, unfinished compiler project started in 2nd course in university. It translates source code written in a C-like language into x86 assembly. Only basic expressions and some statements are implemented.

The parser transforms the source code into an AST, from which an IR (Intermediate Representation) tree is built (a binary tree with opcode and arguments).

The code generator is based on the paper "Engineering a Simple, Efficient Code Generator Generator" by C. W. Fraser, D. R. Hanson, and T. A. Proebsting (1992). Basically, it traverses the IR tree and attempts to cover/tile it with 'lowest-cost' instructions. (The code generator itself is automatically generated from a machine description.)

About

an unfinished compiler project started during my 2nd in uni

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published