浏览该文件的文档.
38 if (expr.
isEmpty())
return false;
57 warn(fileName,lineNr,
"problem evaluating expression '%s': %s",
71 return c==
'&' || c==
'|' || c==
'!';
79 return (c>=
'A' && c<=
'Z') || (c>=
'a' && c<=
'z') || c==
'_';
84 return isAlpha(c) || (c>=
'0' && c<=
'9') || c==
'-' || c==
'.' || (((
unsigned char)c)>=0x80);
94 if (opName==
"&&") {
return AND; }
95 if (opName==
"||") {
return OR; }
98 if (opName==
"!") {
return NOT; }
116 while (*
m_e ==
' ' || *
m_e ==
'\t' || *
m_e ==
'\n')
130 if (*
m_e ==
'(' || *
m_e ==
')')
178 while (opId==
AND || opId==
OR)
223 m_err=
"Parenthesis ) missing";
251 m_err=
"Unexpected end of expression";
256 m_err=
"Value expected";
272 case AND:
return lhs && rhs;
273 case OR:
return lhs || rhs;
286 return std::find(list.begin(),list.end(),varName.
str())!=list.end();
std::vector< std::string > StringVector
bool isEmpty() const
Returns TRUE iff the string is empty
static bool isAlphaNumSpec(const char c)
bool parseLevel1()
conditional operators AND and OR
void warn(const QCString &file, int line, const char *fmt,...)
TOKENTYPE m_tokenType
type of the token
void getToken()
Get next token in the current string expr.
QCString m_token
holds the token
bool evalOperator(const int opId, bool lhs, bool rhs)
evaluate an operator for given values
QCString m_err
error state
static bool isAlpha(const char c)
checks if the given char c is a letter or underscore
bool evalVariable(const QCString &varName)
evaluate a variable
QCString m_expr
holds the expression
const char * m_e
points to a character in expr
bool parseLevel3()
parenthesized expression or variable
bool parse(const QCString &fileName, int lineNr, const QCString &expr)
Copyright (C) 1997-2015 by Dimitri van Heesch.
int getOperatorId(const QCString &opName)
returns the id of the given operator returns -1 if the operator is not recognized
QCString & setNum(short n)
static bool isDelimiter(const char c)
checks if the given char c is a delimiter minus is checked apart, can be unary minus
const char * qPrint(const char *s)
const char * data() const
Returns a pointer to the contents of the string in the form of a 0-terminated C string
bool resize(size_t newlen)
Resizes the string to hold newlen characters (this value should also count the 0-terminator).
#define Config_getList(name)
This is an alternative implementation of QCString.