Skip to main content
Back to Work

Trilex Compiler in Python

Compiler Construction · Team Project
Built
Team Member

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.

Trilex Compiler interface concept showing source code, token summary, compiler pipeline, output console, and parse tree
Compiler interface concept1 / 8

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.

Source .tri program → Scanner and token generation → CFG and parser rules → LL(1) predictive parsing → Semantic analysis

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

Python · Scanner · Parser · CFG · LL(1) · Semantic Analysis

Project Context

Team members: Taha Fayyaz, Wajeeha Kamran, and Naila Habib.