Day 1 - Building the Lexer for Our New Programming Language
Day 1 - Building the Lexer for Our New Programming Language Welcome to Day 1 of our journey in creating a new programming language! Today, we’re diving into the foundational step of building the lexer, which is a crucial component in interpreting our code. Let’s explore the details of what we accomplished, the keywords we chose, and the rationale behind them. What We Achieved Today 1. Lexer Implementation: We successfully implemented the lexer for our new programming language. The lexer, or lexical analyzer, is responsible for breaking down source code into tokens that the parser can understand. This process is essential for interpreting and compiling code. File Created: lexer.py Main Functionality: Tokenization of the source code into identifiable units like keywords, identifiers, operators, and numbers. Token Types: We defined various token types, including NUMBER , IDENTIFIER , INK (our variable keyword), and more. 2. Keywords Chosen: For variable declarations, we...