Finite State Machine Desk Calculator

January 2024 - May 2024

In this project, I developed a desk calculator in Python by implementing a deterministic finite automaton (DFA) for lexical analysis and a pushdown automaton (PDA) for parsing and evaluating arithmetic expressions. The DFA tokenized input into numbers, variables, and operators, while the PDA processed these tokens to evaluate expressions and assignments based on a defined grammar. I managed variable storage with a symbol table, handled errors for invalid tokens or expressions, and performed stack-based evaluation to compute results.

Skills

  • Python

  • Lexical Analysis

  • Deterministic Finite Automata

  • Pushdown Automata

  • Parsing

  • Grammar Implementation

  • Automata Theory

Social Media Links