Home | Site Map
Sunlight

BooleanParse

Introduction

BooleanParse is a simple Boolean expression parser. It illustrates many of the concepts necessary in writing expression parsers.

BooleanParse Code Notes

You can download a Zip file of the source code, including a Microsoft Visual C++ project you can use to build the project.

Things to note:

  • The program first reads the expression and parses it into a RPN stack. It then goes through and evaluates each of the operands, then evaluating the stack. It's not the most efficient way to evaluate an expression, but it's closer to what compilers will do.

BooleanParse Download

Source code (4k): BooleanParseSrc.zip

Executable (44k): BooleanParse.exe