My Project
|
#include <condparser.h>
Public Member Functions | |
CondParser () | |
bool | parse (const char *fileName, int lineNr, const char *expr) |
Private Types | |
enum | TOKENTYPE { NOTHING = -1, DELIMITER, VARIABLE, UNKNOWN } |
enum | OPERATOR_ID { UNKNOWN_OP = -1, AND = 1, OR, NOT } |
Private Member Functions | |
void | getToken () |
bool | parseLevel1 () |
bool | parseLevel2 () |
bool | parseLevel3 () |
bool | parseVar () |
bool | evalOperator (const int opId, bool lhs, bool rhs) |
bool | evalVariable (const char *varName) |
int | getOperatorId (const QCString &opName) |
Private Attributes | |
QCString | m_err |
error state | |
QCString | m_expr |
holds the expression | |
const char * | m_e |
points to a character in expr | |
QCString | m_token |
holds the token | |
TOKENTYPE | m_tokenType |
type of the token | |
Copyright (C) 1997-2015 by Dimitri van Heesch.
Permission to use, copy, modify, and distribute this software and its documentation under the terms of the GNU General Public License is hereby granted. No representations are made about the suitability of this software for any purpose. It is provided "as is" without express or implied warranty. See the GNU General Public License for more details.
Documents produced by Doxygen are derivative works derived from the input used in their production; they are not affected by this license.
C++ Expression parser for EXTABLED_SETIONS in Doxygen
Features used: Operators: && AND operator || OR operator ! NOT operator
Definition at line 27 of file condparser.h.
|
private |
Enumerator | |
---|---|
UNKNOWN_OP | |
AND | |
OR | |
NOT |
Definition at line 43 of file condparser.h.
|
private |
|
inline |
Definition at line 31 of file condparser.h.
|
private |
evaluate an operator for given valuess
Definition at line 288 of file condparser.cpp.
References AND, m_err, and OR.
Referenced by parseLevel1().
|
private |
evaluate a variable
Definition at line 304 of file condparser.cpp.
References Config_getList.
Referenced by parseVar().
|
private |
returns the id of the given operator returns -1 if the operator is not recognized
Definition at line 112 of file condparser.cpp.
References AND, NOT, OR, and UNKNOWN_OP.
Referenced by parseLevel1(), and parseLevel2().
|
private |
Get next token in the current string expr. Uses the data in m_expr pointed to by m_e to produce m_tokenType and m_token, set m_err in case of an error
Definition at line 129 of file condparser.cpp.
References DELIMITER, isAlpha(), isAlphaNum(), isDelimiter(), m_e, m_err, m_token, m_tokenType, NOTHING, UNKNOWN, and VARIABLE.
Referenced by parse(), parseLevel1(), parseLevel2(), parseLevel3(), and parseVar().
bool CondParser::parse | ( | const char * | fileName, |
int | lineNr, | ||
const char * | expr | ||
) |
Copyright (C) 1997-2015 by Dimitri van Heesch.
Permission to use, copy, modify, and distribute this software and its documentation under the terms of the GNU General Public License is hereby granted. No representations are made about the suitability of this software for any purpose. It is provided "as is" without express or implied warranty. See the GNU General Public License for more details.
Documents produced by Doxygen are derivative works derived from the input used in their production; they are not affected by this license.
C++ Expression parser for ENABLED_SECTIONS in Doxygen
Features used: Operators: && AND operator || OR operator ! NOT operator parses and evaluates the given expression.
Definition at line 34 of file condparser.cpp.
References DELIMITER, getToken(), m_e, m_err, m_expr, m_token, m_tokenType, NOTHING, parseLevel1(), and warn().
|
private |
conditional operators AND and OR
Definition at line 194 of file condparser.cpp.
References AND, evalOperator(), getOperatorId(), getToken(), m_token, OR, and parseLevel2().
Referenced by parse(), and parseLevel3().
|
private |
NOT
Definition at line 212 of file condparser.cpp.
References getOperatorId(), getToken(), m_token, NOT, and parseLevel3().
Referenced by parseLevel1().
|
private |
parenthesized expression or variable
Definition at line 233 of file condparser.cpp.
References DELIMITER, getToken(), m_err, m_token, m_tokenType, parseLevel1(), and parseVar().
Referenced by parseLevel2().
|
private |
Definition at line 257 of file condparser.cpp.
References evalVariable(), getToken(), m_err, m_token, m_tokenType, and VARIABLE.
Referenced by parseLevel3().
|
private |
points to a character in expr
Definition at line 56 of file condparser.h.
Referenced by getToken(), and parse().
|
private |
error state
Definition at line 54 of file condparser.h.
Referenced by evalOperator(), getToken(), parse(), parseLevel3(), and parseVar().
|
private |
|
private |
holds the token
Definition at line 58 of file condparser.h.
Referenced by getToken(), parse(), parseLevel1(), parseLevel2(), parseLevel3(), and parseVar().
|
private |
type of the token
Definition at line 59 of file condparser.h.
Referenced by getToken(), parse(), parseLevel3(), and parseVar().