/Equations-Processor

An equation processor application using linked stack and cursor array implementations of a linked stack.

Primary LanguageJavaMIT LicenseMIT

Equations Processor Application

This project involves the implementation of an equation processor application using linked stack and cursor array implementations of a linked list. The application is designed to read equations from a special text file with a .242 extension, process them, and provide various functionalities.

Data Structures

  1. Implemented the linked stack using a cursor array of Sections.
  2. Defined one cursor array to create as many stacks of equations as needed.

Equation File Format

The equation file follows a specific format:

  1. The file must start with the tag <242> and end with </242>.
  2. Within these tags, there can be one or more sections, each starting with < section > and ending with < /section >.
  3. Inside a section, there can be optional infix and/or postfix sections, each starting with or and ending with or respectively.
  4. Each section contains one or more equations, each starting with and ending with .

image

Loading Equations

  1. Click the "Load" button to open a file chooser and select an equation file.
  2. The selected file path will be displayed next to the button.
  3. The application will check if the file tags are balanced, indicating a valid file.
  4. Equations from the first section will be loaded.
  5. For infix equations, they are converted to postfix and then evaluated. For postfix equations, they are converted to prefix and then evaluated.

image

image

Navigation

  1. Use the "Next" and "Prev" buttons to navigate through equation sections.
  2. "Next" displays equations from the next section (if exists), and "Prev" displays equations from the previous section (if exists).

image

image

image