Skip to content

Latest commit

 

History

19 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 

Repository files navigation

Expression Evaluator Calculator Using Shunting Yard Algorithm

  • There are 6 operator types (DIV,MUL,SUB,UNARY_SUB,ADD,PERCENT)
struct token {
   enum type t;
   union {
       int precedence;
       double operand;
   } fields;
};
#define PLUS 10 /* + */
#define SUB 10  /* - */
#define MUL 11 /* * */
#define DIV 11 /* / */
#define PER 11 /* p */
#define UNARY  12 /* unary - */
  • Operands are only double values, highest precedence operator is UNARY(unary_sub)
  • Numbers collected as double value in C
  • A p B is doing A * (B/100)
  • Program has a one Text Box and Button, computed result printed in MessageBoxA function
  • Does not support open '(' and closed ')' parentheses

Requires MSVC C Desktop Development Toolset

image image
image image

About

A zero-dependency Win32 C application evaluating math expressions via a custom lexer, parser, and Dijkstra's Shunting-yard algorithm.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages