Skip to content

noahbean33/compiler

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

C Compiler

This repository contains a C compiler built from scratch. It is designed to compile a subset of the C programming language and generate 32-bit Intel assembly code.

Features

  • Lexical Analysis: A custom lexer tokenizes C source code.
  • Parsing: A parser builds an Abstract Syntax Tree (AST) from the tokens.
  • Code Generation: The compiler generates 32-bit Intel assembly language.
  • Semantic Validation: A semantic validator ensures code correctness according to C language rules.
  • Preprocessor: Supports macros like #define, #ifdef, and sizeof, as well as including header files.
  • Language Support: Compiles a subset of C, including:
    • Pointers
    • Structs and Unions
    • Arrays
    • Functions
    • Loops (for, while)
    • Conditional statements (if, else)
  • Standard Library Compatibility: The generated code is compatible with the GCC standard library.

About

a c compiler from scratch

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published