UFO: Alien Invasion
Loading...
Searching...
No Matches
BinaryExpressionParser Class Reference

Evaluates stuff like this expression. More...

Collaboration diagram for BinaryExpressionParser:
Collaboration graph

Public Member Functions

 BinaryExpressionParser (const char *expr, BEPEvaluteCallback_t varFuncParam, const void *userdataPtr)
bool getResult () const
binaryExpressionParserError_t getError () const

Private Member Functions

void SkipWhiteSpaces (const char **s) const
void NextChar (const char **s) const
 Advance to the next char that is no whitespace.
const char * GetSwitchName (const char **s)
bool CheckOR (const char **s)
 Evaluates or and xor in the given string. This is the entry point, it delegates to the and checks that are done in CheckAnd.
bool CheckAND (const char **s)

Private Attributes

binaryExpressionParserError_t binaryExpressionParserError
BEPEvaluteCallback_t varFunc
char varName [MAX_VAR]
bool result
const voiduserdata

Detailed Description

Evaluates stuff like this expression.

(x & !y) ^ z

Definition at line 36 of file binaryexpressionparser.cpp.

Constructor & Destructor Documentation

◆ BinaryExpressionParser()

BinaryExpressionParser::BinaryExpressionParser ( const char * expr,
BEPEvaluteCallback_t varFuncParam,
const void * userdataPtr )
inline

Member Function Documentation

◆ CheckAND()

bool BinaryExpressionParser::CheckAND ( const char ** s)
inlineprivate

◆ CheckOR()

bool BinaryExpressionParser::CheckOR ( const char ** s)
inlineprivate

Evaluates or and xor in the given string. This is the entry point, it delegates to the and checks that are done in CheckAnd.

Returns
The result of the evaluation

Definition at line 79 of file binaryexpressionparser.cpp.

References binaryExpressionParserError, CheckAND(), NextChar(), result, and SkipWhiteSpaces().

Referenced by BinaryExpressionParser(), and CheckAND().

◆ getError()

binaryExpressionParserError_t BinaryExpressionParser::getError ( ) const
inline

Definition at line 169 of file binaryexpressionparser.cpp.

References binaryExpressionParserError.

Referenced by BEP_Evaluate().

◆ getResult()

bool BinaryExpressionParser::getResult ( ) const
inline

Definition at line 164 of file binaryexpressionparser.cpp.

References result.

Referenced by BEP_Evaluate().

◆ GetSwitchName()

const char * BinaryExpressionParser::GetSwitchName ( const char ** s)
inlineprivate

Definition at line 60 of file binaryexpressionparser.cpp.

References varName.

Referenced by CheckAND().

◆ NextChar()

void BinaryExpressionParser::NextChar ( const char ** s) const
inlineprivate

Advance to the next char that is no whitespace.

Definition at line 53 of file binaryexpressionparser.cpp.

References SkipWhiteSpaces().

Referenced by CheckAND(), and CheckOR().

◆ SkipWhiteSpaces()

void BinaryExpressionParser::SkipWhiteSpaces ( const char ** s) const
inlineprivate

Definition at line 44 of file binaryexpressionparser.cpp.

Referenced by CheckAND(), CheckOR(), and NextChar().

Field Documentation

◆ binaryExpressionParserError

binaryExpressionParserError_t BinaryExpressionParser::binaryExpressionParserError
private

Definition at line 38 of file binaryexpressionparser.cpp.

Referenced by BinaryExpressionParser(), CheckAND(), CheckOR(), and getError().

◆ result

bool BinaryExpressionParser::result
private

Definition at line 41 of file binaryexpressionparser.cpp.

Referenced by BinaryExpressionParser(), CheckAND(), CheckOR(), and getResult().

◆ userdata

const void* BinaryExpressionParser::userdata
private

Definition at line 42 of file binaryexpressionparser.cpp.

Referenced by BinaryExpressionParser(), and CheckAND().

◆ varFunc

BEPEvaluteCallback_t BinaryExpressionParser::varFunc
private

Definition at line 39 of file binaryexpressionparser.cpp.

Referenced by BinaryExpressionParser(), and CheckAND().

◆ varName

char BinaryExpressionParser::varName[MAX_VAR]
private

Definition at line 40 of file binaryexpressionparser.cpp.

Referenced by BinaryExpressionParser(), and GetSwitchName().


The documentation for this class was generated from the following file: