skol

Architecture

Component Breakdown

Component Completeness Source Code Purpose
CLI Incomplete cli paclage Parses command line-flags and prepares files for compilation or analysis.
Lexer Complete lexer package Breaks meaningless plain text into a sequence of meaningful tokens.
Parser Incomplete parser package Consumes tokens from the lexer and constructs an AST.
AST Incomplete ast package Represents the structure of a source code file.
Typechecker Incomplete typecheck package Ensures that everything in the AST has the correct typing. (ensures a int variable isn’t set to a string, etc.)
IR Incomplete N/A Breaks a program down into simple instructions to allow for easier compilation to binary formats.
Codegen Incomplete codegen package a) Transpiles Skol code into another language from the AST.
b) Compiles into executables from IR.

Usual flow for compilation

  1. The CLI reads the source code.
  2. A parser is created, which contains it’s own lexer for the previously read source code.
  3. The parser consumes tokens, creates the adequate nodes and constructs an AST out of them.
  4. The typechecker ensures type correctness in the program.

Component Completeness Breakdown

CLI

Lexer

Parser

AST

Typechecker

IR

Codegen