Skip to content

A Java-based interpreter for a custom toy programming language with concurrency, type checking, and a JavaFX GUI. Built using MVC architecture, OOP, and functional programming principles.

Notifications You must be signed in to change notification settings

Robert076/Interpreter-for-Toy-Language

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🧪 Toy Language Interpreter (Java)

A Java-based interpreter for a custom-designed concurrent toy programming language, built using advanced programming concepts and architectural patterns.


📚 Project Overview

This interpreter was developed incrementally as part of university coursework 🎓.
It supports execution of programs written in a custom-defined language, demonstrating key programming principles and complex features 💡.


🛠️ Key Concepts & Features

  • 🧱 Model-View-Controller (MVC) architecture
  • 👨‍💻 Object-Oriented Programming (OOP): interfaces, inheritance, polymorphism
  • 🧵 Concurrency: Multi-threaded execution with fork statements and Java's ExecutorService
  • 🗃️ Heap Management: Dynamic memory allocation with garbage collection
  • 📂 File Operations: Open, read, write, and close files using Java I/O streams
  • 🧬 Functional Programming: Recent labs applied high-order functions for modular, side-effect-free code
  • 🧪 Type Checking: Static type checking before program execution
  • 🖼️ Graphical User Interface (GUI): Interactive GUI built with JavaFX

🧠 Technical Complexity

This project demonstrates advanced technical skills through:

  • 🧰 Implementation of custom data structures (Stack, Dictionary, List) using Java generics
  • 🔍 Simulation of complex language features (expression evaluation, conditional logic)
  • 🤝 Management of concurrent program states with shared resources (Heap, FileTable)
  • ✅ Integration of static type checking to ensure program correctness
  • 📝 Comprehensive logging for debugging and program state visualization

📄 Short Documentation

🧱 Language Elements

🧾 Statements 🔢 Expressions 🧪 Types & Values
Compound (stmt1; stmt2) Arithmetic (+, -, *, /) Integer (int)
Assignment (a = exp) Logical (and, or) Boolean (bool)
Conditional (if) Relational (<, <=, etc.) String (string)
Looping (while) Heap ops (new, rH, wH) Reference (Ref type)
Concurrency (fork) Variable & Constant evaluation

🗂️ Program State Components

  • 🧾 Execution Stack – statement execution order
  • 🧮 Symbol Table – variable-value bindings
  • 🧠 Heap Table – dynamic memory (referenced data)
  • 📤 Output List – printed outputs during execution
  • 📁 File Table – open files and I/O stream data

🖥️ GUI Visualization

The JavaFX interface allows users to:

  • 📝 Select predefined example programs
  • 🔄 Visualize execution steps interactively
  • 👀 Inspect heap memory, symbol tables, execution stacks, file tables, and outputs in real-time

🏆 Achievements

This project received the maximum grade (10/10) 🥇
✅ Due to its technical depth, correctness, elegant architecture, and complete feature set.


About

A Java-based interpreter for a custom toy programming language with concurrency, type checking, and a JavaFX GUI. Built using MVC architecture, OOP, and functional programming principles.

Topics

Resources

Stars

Watchers

Forks

Languages