A Java-based implementation of a small statically typed programming language, built to explore how type systems and interpreters work. The project focuses on catching invalid programs before execution via a dedicated type checking phase, followed by runtime interpretation. The GUI improves accessibility by visualizing the program’s runtime state (e.g., symbol table / heap), making the interpreter easier to understand and debug.
- ✅ Static type checker that validates programs before execution
- ✅ Interpreter runtime that evaluates statements/expressions and manages program state
- ✅ Clear separation between type checking and execution
- ✅ Execution/debug logs and sample input for validation
- ✅ GUI that visualizes runtime memory/state (symbol table / heap)
The language uses an explicit static type system, including:
IntType– integer valuesBoolType– boolean valuesStringType– string valuesRefType– reference types for heap-allocated values
All expressions and statements are validated against these types during the type checking phase, preventing invalid programs from executing.
Custom data structures were implemented to model the language runtime:
MyDictionary<K, V>– used for symbol tables and type environmentsMyHeap<V>– simulates heap-like memory for reference valuesMyStack<T>– execution stack for program statementsMyList<T>– output collectionMyFileTable– manages file-related runtime state
Each ADT has a clear interface/implementation separation to improve modularity and testability.
- Expressions – arithmetic, logical, relational, and heap-related expressions
- Statements – variable declarations, assignments, control flow, heap operations, and file operations
- Values – runtime representations corresponding to the static types
The interpreter enforces a strict separation between type checking and execution, mirroring real-world language processing pipelines.
- How static type checking prevents runtime errors (type safety)
- Designing a type environment (symbol/type tables) and validating expressions/statements
- How an interpreter manages state (variables, heap-like memory, execution flow)
- Building a maintainable OOP architecture for language components (statements, expressions, types)
- Debugging complex evaluation logic using logs and repeatable test inputs
src/– main Java source codetest.in– sample input used for testinglog*.txt– execution/debug logs from different runssrc_zip.zip– archived source snapshot
- Clone the repository:
git clone https://github.com/unteajessica/MAP_Assignments.git