Compiler Construction sounded cool. Then I actually tried building one. I started with the first stage: a Lexical Analyzer built from scratch using C and Flex, with a Harry Potter–inspired syntax (numspell, truthcharm, beginmagic). At first, matching tokens with regular expressions felt straightforward. Then the problems started. Valid-looking code broke. Invalid code slipped through. That’s when I realized: a lexer that isn’t strict is useless. So I focused heavily on error detection and reporting, making the lexer explicitly catch: • Digit-prefixed identifiers (5abc) • Unterminated strings and comments • Invalid number formats It doesn’t just tokenize the magic — it rejects broken spells. This was my first real lesson in compilers: being precise matters more than being permissive. 🔗 GitHub Repo: https://lnkd.in/dBeeViyZ #ComputerScience #CompilerConstruction #Flex #CProgramming #CSStudent #CodingJourney
Keep up the Hustle!
Engr. Muhammad Saad Engr. Abdullah Afzal LEXICAL analyzer xD
Keep it up bro