← Back to selected work
Compiler designPublic source

Greek++ Compiler

Taking Greek-language source code all the way to RISC-V assembly.

Team project · Compiler implementationPython / Lexer / Parser / Quadruples / RISC-V
The context

A university team project implementing a compiler for Greek++, an educational procedural language with Greek keywords, functions, procedures, control flow and parameter passing.

View repository ↗
How it connects

The workflow.

  1. 01Greek++ source
  2. 02Lexer & parser
  3. 03Quadruples + symbols
  4. 04RISC-V assembly

The compiler produces intermediate code, symbol-table output and final assembly files.

Engineering details

Inside the work.

01

Lexical and syntax analysis

Python lexical analysis recognizes identifiers, keywords, operators and nested comments. Recursive-descent parsing checks the grammar and works with symbol information for semantic checks.

02

Intermediate representation

Quadruples represent operations and control flow. Backpatching resolves branches, while temporary variables represent intermediate expression results.

03

Subprograms and final code

RISC-V code generation handles activation records, parameters and access to non-local variables. Functions and procedures support call-by-value and call-by-reference behavior.

What I took from it.

  • Intermediate representations make source-language behavior easier to translate systematically.
  • Subprograms connect parsing decisions to runtime stack-frame behavior.
  • Symbol tables and explicit output files make compiler debugging more inspectable.
See for yourself

Source & documentation.

Language & compiler documentation↗
Next projectFooty Greece↗