Skip to content

How to read the codebase

Siddhartha Dhar Choudhury edited this page Jan 23, 2021 · 1 revision

How to read the codebase?

This is going to be a short one. So, let's understand how to read the codebase. The best way to get started reading the codebase is to follow the following order:-

  1. simc/simc.py
  2. simc/lexical_analyzer.py
  3. simc/parser/simc_parser.py
  4. compiler.py

The first file is the entry point of simC compiler, this is where all the core and helper components are instantiated and interacted with. Files from 2 till 4 contain the code of the core components of simC along with usage of the helper components.

You will find other files in simc/parser directory, and you can for most part ignore these files, as these contain separate parsing functions for the different features of simC. When starting to work on an issue you can go through the relevant parser file, other than that the simc_parser.py should give an idea of how the parser works in general.

We have tried to make the code as readable as possible, with descriptive comments wherever necessary. If you believe any part of the codebase could be made more readable then do open a feature issue :)