Trilex Compiler in Python
A custom programming-language and compiler-construction project in Python covering lexical analysis, scanner implementation, grammar design, parser implementation, LL(1) parsing, and semantic analysis.

Compiler workspace
A compiler-workspace concept that brings source code, token summaries, pipeline stages, output, and parse-tree visibility into one place.
Overview
Trilex is a custom programming-language and compiler-construction project developed in Python for a Compiler Construction course.
The Problem
The project explores how source code is transformed into meaningful program structures through language definition, lexical analysis, syntax analysis, parsing, and semantic validation.
The Approach
The team designed a small custom language and implemented a compiler pipeline that turns `.tri` source programs into tokens, parses their structure, validates grammar rules, and performs semantic checks.
Compiler workflow
Trilex brings together the core stages of compiler construction, moving from source input and token recognition through grammar-driven parsing and semantic validation.
My Contribution
Collaborated with Wajeeha Kamran and Naila Habib on the team-based Trilex Compiler project. Contributed to the design, implementation, and testing of compiler-construction components across the project workflow.
Key Capabilities
- Custom programming-language design
- Lexical analyzer and scanner
- Token generation
- Regular expressions and finite automata concepts
- Context-free grammar design
- Parser implementation
- LL(1) parsing
- Semantic-analysis test cases
- Sample `.tri` programs
Technology Stack
Project Context
Team members: Taha Fayyaz, Wajeeha Kamran, and Naila Habib.