← Back to Portfolio

Expression Evaluator

Expression Evaluator
cppJan 2026Solo Developer

Project Overview

A mathematical interpreter that parses text expressions containing operators, brackets, and functional variables, compiling them into abstract syntax trees (AST) to evaluate results in real-time. Features recursive descent parsing and infix-to-postfix stack compilers.

Key Features

  • Evaluates standard arithmetic, trigonometry, logarithms, and user-defined functions
  • Recursive descent parser with dynamic operator precedence mapping
  • Detailed syntax error highlighting pointing to precise invalid token indices
  • Variable symbol table for solving equations with dynamic value substitution

Technical Challenges & Solutions

Resolving operator associativity and bracket-matching edge cases in complex nested equations. Solved by implementing the Shunting-yard algorithm backed by an AST tree node builder, ensuring mathematical order of operations is strictly followed.