Skip to content

lazy-seal/CompilerFromScratch

Repository files navigation

CompilerFromScratch

Compiles tiny programming language into ir diagram (dot language)

Example

Below is the sample code of fibonaci sequence in tiny programming language

main
var x;
 function fibonacci(n); {
   if n <= 1 then
     return n
   fi;
   return call fibonacci(n - 1) + call fibonacci(n - 2)
 };
 {
   let x <- call InputNum;
   let x <- call fibonacci(x);
   call OutputNum(x);
   call OutputNewLine
 }.

Below is the visualization of the IR representation produced by the project

image

About

Compiles tiny programming language into ir diagram (dot language)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages