Skip to content

davidcristian/Interpreter-Java

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Interpreter

A console-driven application that allows users to run pre-made programs. Includes a debugger and a selection of garbage collectors.

The enhanced version of the interpreter console with a graphical user interface (GUI) built using JavaFX.

Overview

This project is an implementation of an interpreter console for a custom programming language. It uses the model-view-controller (MVC) architectural pattern and is built on object-oriented concepts. The main functionalities include interpreting various statements, expressions, types, and values defined in the language. Additionally, it handles file operations, heap management, garbage collection, and supports concurrent programming. A GUI using JavaFX is also implemented for an interactive experience.

Features

  1. Core Components:

    • Statements: Compound, Print, Assignment, If, Variable Declaration, No Operation.
    • Expressions: Arithmetic, Value, Logic, Variable, Relational.
    • Types: Integer, Boolean, String, Reference.
    • Values: Integer, Boolean, String, Reference.
    • ADTs: Execution Stack, Output List, Symbol Table, File Table, Heap Table.
  2. Program State: Represents the state of the program at a given moment.

  3. Repository: Stores and manages the list of program states.

  4. Controller: Manages execution steps and logs program state.

  5. View: Supports selection and execution of predefined programs.

  6. Exception Handling: Custom exceptions for ADT, expression, and statement execution errors.

  7. File Operations: Handling file read, write, and close operations.

  8. Heap Management: Includes a Heap Table and supports new object creation and heap read/write.

  9. Garbage Collector: Implements both unsafe and safe garbage collection.

  10. Concurrent Programming Support: Handles multiple program states (threads) concurrently.

  11. Type Checker: Ensures type consistency before program execution.

  12. GUI: Interactive JavaFX-based graphical user interface.

See the console version's REQUIREMENTS.md file and the JavaFX version's REQUIREMENTS.md file for more details.

Getting Started

Prerequisites

  • Java Version: OpenJDK 19.0.2 with JavaFX
  • Development Environment: Any IDE that supports Java and JavaFX.

Installation

  1. Clone the repository.
  2. Open the project in your IDE.
  3. Ensure Java 19 with JavaFX is set up in your project settings.
  4. Build and run the project.

Usage

  1. Select a program from the provided list.
  2. Interact with the GUI to execute the program and observe changes in program state, heap table, output list, and more.
  3. Use the "One Step" button to execute one step at a time and observe the changes; or
  4. Use the "All Steps" button to execute the entire program at once and examine the final state.

Preview

Program Chooser Preview

Program Runner Preview

License

This project is licensed under the GNU General Public License v3.0 - see the LICENSE file for details.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors