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 view the source code here: BooleanParse.cpp. You can also 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

 

Copyright © David McCabe, 1998 - 2001. All rights reserved.

You will need to download and install the m-math control to display any equations on this Web site. Without this control, you will not see most of the equations. Please do not e-mail me asking why the equations do not display!

[an error occurred while processing this directive]