Skip to content

d-olivr/basic-compiler

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🧠 Basic Compiler Project

🎯 Overview

This project consists of the development of a basic compiler as part of the Compilers undergraduate course. The main goal is to understand, in practice, how programming languages are processed. The project focus on core compiler construction concepts such as lexical, syntactic, and semantic analysis.


⚠️ [TO BE DEFINED] Some sections that follow will be updated throughout the development.


⚙️ How does it work?

The compiler will process source code written in a custom language and translate it into C code, which can then be compiled using a standard C compiler such as the gcc (GNU Compiler Collection)

This approach allows us to focus on the compilation process itself while leveraging a mature backend for execution.


🛠 Technical Stack

  • Programming Language: [TBD]
  • Target Language: C
  • Parsing Strategy: TBD
  • Tools/Libraries: TBD

🧩 Compiler Structure

The implementation will follow the traditional compiler pipeline:

  • Lexical Analysis (Scanner): Tokenization of source code
  • Syntactic Analysis (Parser): Grammar validation and AST generation
  • Semantic Analysis: Type checking and scope resolution
  • Intermediate Code Generation: Translation to C
  • Error Handling: Detection and reporting of compilation errors

📚 Project Roadmap

  • Arithmetic Operators
  • Explicit Declaration
  • Primitive Data Types (int, float, boolean, string, char)
  • Relational Operators (producing boolean)
  • Logical Operators (producing boolean)
  • Unary Operators
  • Expressions
  • Variable Initialization
  • String Concatenation
  • Type Conversion
  • Global Scope
  • Blocks
  • Static Scope
  • Decision Commands (if, if/else, switch)
  • Conditional Expressions
  • Loop Commands (for, while, do/while)
  • Loop Control Mechanisms
  • Arrays
  • Array Initialization
  • Input and Output Commands
  • Compound Operators
  • Subprograms (Functions)
  • Error Detection

👥 Contributors



🚀 Getting Started

Instructions on how to clone, build, and run the project will be added once the development environment is established.

  1. git clone https://github.com/<your-username>/<your-repo>.git
  2. ...

About

Design and implementation of a basic compiler for the Compilers undergraduate course

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors