Skip to content

abimek/c_compiler

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Current Working On

-- Logging --> Need to implement custom log class to implement my own printing system for errors that makes it easier to see where the error is. --> Afterwards I need to throw an exception and catch it in main, letting the program close

  • After I need to go and clean up my memory usage if that's any way possible.

A C Compiler I'm working on for fun right now

I will be using llvm for the backend connections and slowly begin implementing more language features as I go along. Currently working on this during the end of my days for fun, making good progress. Hopefully I can bootstrap this thing if it works, although IDK if I really want to reimplement the entirety of the language again in another langague.

Lessons Learned from this project

  • Wrap objects using unique_ptr
  • Use more polymorphism in codebase
  • Split up datastructures used throughout the codebase (IE: AST Tree) into their own files / namespaces.
  • Need to incorproate a checker / validator for my statements

Important Node

I need to implment proper C++ memory handling, especially with my usage of pointers to heap allocated memory. Will implment this sometime in the near future, likely with unique_ptr.

I will likely rewrite this to follow better practices or slowly update it.

  • Proper memory management (smart pointers)

Lexing

Parsing

  • Extern functions

  • return statement

  • Error Handling w/ tips

  • Variable Assignment / Mutability

  • Arrays

  • Access operator (testing.value for structs)

  • Expression

  • Binary Operator

  • Operator Precedence

  • Function Call

  • Variable Declerations

  • Struct Decleration

  • Function Decleration

Primitives

  • Int

  • Int32

  • Int64

  • Float

  • Boolean

  • String => Will represent this as a primitive

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published