"The code is exactly
how I would like to write code and the algorithms used are very
efficient and well-documented."
Van T. Dinh, Microsoft MVP
|
|
Class: CExpressionEvaluator
Class to implement expression evaluation. Expression evaluation is a common need in many programs, especially if you deal with numbers and operators.
|
Procedure Name
|
Type
|
Description
|
|
(Declarations)
|
Declarations
|
Declarations and private variables for the CExpressionEvaluator class
|
|
Expression
|
Property
|
Gets the expression to evaluate.
|
|
Postfix
|
Property
|
Gets the postfix representation of the expression string
|
|
CharType
|
Private
|
Determines the type of the current character
|
|
Class_Initialize
|
Initialize
|
Set initial values to defaults which may be overridden with property settings
|
|
ConvertToPostfix
|
Private
|
Converts the expression to postfix and stores the result in m_strPostfix
|
|
Evaluate
|
Method
|
Evaluates the expression. For simplicity the postfix representation of the expression is evaluated.
|
|
GetNextToken
|
Private
|
Returns the next token in the string identified by the text property
|
|
HandleSeparator
|
Private
|
Handles a separator character
|
|
HandleToken
|
Private
|
Handles a token character
|
|
HandleWhiteSpace
|
Private
|
Handles a whitespace character
|
|
ParseExpression
|
Private
|
Parses an expression
|
|
ParseFactor
|
Private
|
Parses a factor
|
|
ParseTerm
|
Private
|
Parse a term. A term is something like 2+7, or 1 + sin(1), while a token is the smallest meaningful piece of data, such as 2 or sin
|
|
PopResult
|
Private
|
Pops an item off the stack
|
|
PushResult
|
Private
|
Pushes an item onto the stack
|
|
SetTokenString
|
Private
|
Set the string used by the tokenizer
|
Overview of Total Visual SourceBook
The source code in Total Visual
SourceBook includes modules and classes for Microsoft Access, Visual
Basic 6 (VB6), and Visual Basic for Applications (VBA) developers. Easily
add this professionally written, tested, and documented royalty-free code
into your applications to simplify your application development efforts.
Additional Resources
|
|