46 while (**s ==
' ' || **s ==
'\t')
65 while (**s >
' ' && **s !=
'^' && **s !=
'|' && **s !=
'&' && **s !=
'!' && **s !=
'(' && **s !=
')') {
83 BEP_NONE, BEP_OR, BEP_EXCLUSIVE_OR
89 if (goOn == BEP_EXCLUSIVE_OR)
97 }
else if (**s ==
'^') {
98 goOn = BEP_EXCLUSIVE_OR;
103 }
while (goOn != BEP_NONE && !binaryExpressionParserError);
135 result &= value ^ negate;
147 }
while (goOn && !binaryExpressionParserError);
154 binaryExpressionParserError(
BEPERR_NONE), varFunc(varFuncParam), userdata(userdataPtr)
157 const char* str = expr;
160 if (
Q_strvalid(str) && !binaryExpressionParserError)
189 Com_Printf(
"')' expected in binary expression (%s).\n", expr);
192 Com_Printf(
"Unexpected end of condition in binary expression (%s).\n", expr);
195 Com_Printf(
"Variable not found in binary expression (%s).\n", expr);
void NextChar(const char **s) const
Advance to the next char that is no whitespace.
const char * GetSwitchName(const char **s)
BinaryExpressionParser(const char *expr, BEPEvaluteCallback_t varFuncParam, const void *userdataPtr)
Evaluates stuff like this expression.
void Com_Printf(const char *const fmt,...)
binaryExpressionParserError_t
#define Q_strvalid(string)
bool BEP_Evaluate(const char *expr, BEPEvaluteCallback_t varFuncParam, const void *userdata)
void Com_Error(int code, const char *fmt,...)
BEPEvaluteCallback_t varFunc
bool CheckOR(const char **s)
Evaluates or and xor in the given string. This is the entry point, it delegates to the and checks tha...
int(* BEPEvaluteCallback_t)(const char *var, const void *userdata)
definitions common between client and server, but not game lib
binaryExpressionParserError_t getError() const
binaryExpressionParserError_t binaryExpressionParserError
void SkipWhiteSpaces(const char **s) const
bool CheckAND(const char **s)