Skip to content

Welcome to Postfix Pro - the ultimate toolkit for evaluating postfix expressions with style and precision! ๐Ÿš€

Notifications You must be signed in to change notification settings

angelaL8a/RPN-Postfix-Pro-Evaluator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

3 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

ViewCount GitHub top language GitHub language count

๐Ÿฅณ Postfix++: The Ultimate Postfix Expression Evaluator ๐Ÿš€

Miniature Welcome to Postfix++! This project is all about evaluating postfix expressions with a sprinkle of awesomeness. Whether you're a computer science enthusiast, a student tackling algorithms, or just someone who loves cool projects, Postfix++ has something for you. So, let's dive in! ๐ŸŠโ€โ™‚๏ธ

๐Ÿ“š What is Postfix++?

Postfix++ is a C++ project designed to evaluate postfix (reverse Polish notation) expressions. It handles variables, supports a plethora of mathematical operations, and ensures you get the right result every time. No more scratching your head over complex postfix expressions!

Why Postfix Notation?

Postfix notation, also known as Reverse Polish Notation (RPN), eliminates the need for parentheses and operator precedence rules, making it a breeze for both humans and machines to evaluate expressions.

๐Ÿ”ฅ Features

  • ๐Ÿงฎ Comprehensive Postfix Evaluator: From basic arithmetic to advanced functions like logarithms and trigonometry, our evaluator handles it all.
  • ๐Ÿ“ˆ Efficient Data Structures: Implemented with stacks and symbol tables for fast and efficient evaluation.
  • Symbol Table Management: Efficient handling of variable assignments.
  • ๐Ÿ’”Robust Error Handling: Detects and reports invalid expressions and operations.
  • ๐Ÿ› ๏ธModular Design: Easy-to-read, maintain, and extend.
  • ๐Ÿงช Thoroughly Tested: Comes with extensive unit tests to ensure reliability and correctness.

๐Ÿš€ Getting Started

Prerequisites

  • C++ Compiler (like GCC)
  • CMake
  • Google Test (for unit testing)
  • Visual Studio Code (highly recommended for this project)

Installation

  1. Clone the repository:

    git clone https://github.com/yourusername/PostfixPlusPlus.git
    cd PostfixPlusPlus

    IMPORTANT: go first to (tests/README-SETUP.txt)

  2. Build the project:

    cd src
    g++ -std=c++11 main.cpp postfix_evaluator.cpp symbol_table.cpp -o postfix
    .\postfix
  3. Run the tests:

    cmake --build . --config Release
    cd Release
    ls
     test_postfix_evaluator.exe
     test_stack.exe
     test_symbol_table.exe

Example

๐Ÿ“‚ Project Structure

Postfix++
โ”œโ”€โ”€ googletest               # Google Test framework
โ”œโ”€โ”€ src                      # Source files
โ”‚   โ”œโ”€โ”€ main.cpp
โ”‚   โ”œโ”€โ”€ math_operations.hpp
โ”‚   โ”œโ”€โ”€ postfix_evaluator.cpp
โ”‚   โ”œโ”€โ”€ postfix_evaluator.hpp
โ”‚   โ”œโ”€โ”€ stack.hpp
โ”‚   โ”œโ”€โ”€ stack.cpp
โ”‚   โ”œโ”€โ”€ symbol_table.hpp
โ”‚   โ”œโ”€โ”€ symbol_table.cpp
โ”œโ”€โ”€ tests                    # Unit tests
โ”‚   โ”œโ”€โ”€ CMakeLists.txt
โ”‚   โ”œโ”€โ”€ test_postfix_evaluator.cpp
โ”‚   โ”œโ”€โ”€ test_stack.cpp
โ”‚   โ”œโ”€โ”€ test_symbol_table.cpp
โ”œโ”€โ”€ CMakeLists.txt           # CMake build configuration
โ””โ”€โ”€ README.md                # This awesome README file

โœจ Highlights

Symbol Table

The Symbol Table efficiently maps variable names to their values using a hash table. It's designed to handle variables named from A to Z, making it both space and time efficient.

Postfix Evaluator

Our Postfix Evaluator processes expressions, handling everything from simple arithmetic to complex mathematical functions. With robust error handling and conversion between types, it ensures smooth and accurate evaluation.

Stack Operations

The project uses a custom stack implementation to handle intermediate values during expression evaluation. This ensures that operations are performed in the correct order and that our evaluator is both fast and reliable.

๐Ÿค Contributing

We welcome contributions! Feel free to fork this repository, make your changes, and submit a pull request. If you find any bugs or have feature requests, please open an issue. Let's make Postfix++ even better together!

๐Ÿ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

Video demonstration: https://vimeo.com/965105062?share=copy
Report: FINAL REPORT - Postfix++ ADS II Mid-term.pdf

About

Welcome to Postfix Pro - the ultimate toolkit for evaluating postfix expressions with style and precision! ๐Ÿš€

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published