Evaluate Numerical Expressions

This is a collection of material to help create a program to evaluate numerical expressions. This materials is for teachers or a students to help them create an evaluator program.

Please read through the material before designing and coding.

Project Description

Numeric Expression Grammar in Backus–Naur form (BNF)

Numeric Expression Tokenizer (Python Code Lexical Analyzer)

Numeric Expression Evaluator (Pseudo Code Algorithm)

Numeric Expression Evaluator (Python Code)

Integer State Diagram

Float / Scientific Notation State Diagram

Using stacks: parsing of arithmetic expressions (pdf)

Note: There is a lot of material and better material on the web.

Topics For Teachers

  1. compilers, parts of a compiler, etc
  2. lexical analyzer, tokens, tokenizer
  3. BNF
  4. Yacc, Lex, Bison, etc (lightly as a general topic; not to deep)