Skip to content

dheerajraina/Compiler

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

83 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Implementation of a Compiler from scratch for a custom language(DhLang) in C

Current Progress :-

int age
age := 60
print(age)

int temp := 90 + 10
print(temp)

for i from 0 to 10 {
int number := 10
print(number)
}

int number
number := 90
print(number)

if (number>age){
print(number)
}
elif(age>number){
print(age)
}
else{
print(temp)
}

Features

  • Datatype (int)
  • Variable declaration
  • Value assignment to declared variable(during declaration or separately)
  • Printing declared and initialized variable
  • Binary operation (sum)
  • Loop (for-loop)
  • Variable Scoping
  • if-elif-else conditionals

Project setup (Ubuntu)

  • Clone and enter the repository directory
    git clone repository_url
    cd \path\to\repository_directory
    
  • Run cmake inside build directory
    \path\to\repository_directory\build$ cmake .. && cd ..
    
  • Run the build.sh file
    \path\to\repository_directory$ ./build.sh
    

About

Implementation of a Source to Source compiler in C

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages