Doxygen
|
Copyright (C) 1997-2015 by Dimitri van Heesch. More...
#include <src/condparser.h>
Public Member Functions | |
CondParser () | |
bool | parse (const QCString &fileName, int lineNr, const QCString &expr) |
Copyright (C) 1997-2015 by Dimitri van Heesch. | |
Private Types | |
enum | TOKENTYPE { NOTHING = -1 , DELIMITER , VARIABLE , UNKNOWN } |
enum | OPERATOR_ID { UNKNOWN_OP = -1 , AND = 1 , OR , NOT } |
Private Member Functions | |
void | getToken () |
Get next token in the current string expr. | |
bool | parseLevel1 () |
conditional operators AND and OR | |
bool | parseLevel2 () |
NOT. | |
bool | parseLevel3 () |
parenthesized expression or variable | |
bool | parseVar () |
bool | evalOperator (const int opId, bool lhs, bool rhs) |
evaluate an operator for given values | |
bool | evalVariable (const QCString &varName) |
evaluate a variable | |
int | getOperatorId (const QCString &opName) |
returns the id of the given operator returns -1 if the operator is not recognized | |
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 ENABLED_SECTIONS 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 |
|
private |
evaluate an operator for given values
Definition at line 264 of file condparser.cpp.
References AND, FALSE, m_err, OR, and QCString::setNum().
Referenced by parseLevel1().
|
private |
evaluate a variable
Definition at line 280 of file condparser.cpp.
References Config_getList, and QCString::str().
Referenced by parseVar().
|
private |
returns the id of the given operator returns -1 if the operator is not recognized
Definition at line 91 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 108 of file condparser.cpp.
References DELIMITER, isAlpha(), isAlphaNumSpec(), isDelimiter(), m_e, m_err, m_token, m_tokenType, NOTHING, UNKNOWN, and VARIABLE.
Referenced by parse(), parseLevel1(), parseLevel2(), parseLevel3(), and parseVar().
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 36 of file condparser.cpp.
References DELIMITER, getToken(), QCString::isEmpty(), m_e, m_err, m_expr, m_token, m_tokenType, NOTHING, parseLevel1(), qPrint(), and warn.
Referenced by handleGuard(), startCondSection(), and startCondSection().
|
private |
conditional operators AND and OR
Definition at line 173 of file condparser.cpp.
References AND, evalOperator(), getOperatorId(), getToken(), m_token, OR, and parseLevel2().
Referenced by parse(), and parseLevel3().
|
private |
NOT.
Definition at line 191 of file condparser.cpp.
References getOperatorId(), getToken(), m_token, NOT, and parseLevel3().
Referenced by parseLevel1().
|
private |
parenthesized expression or variable
Definition at line 209 of file condparser.cpp.
References DELIMITER, FALSE, getToken(), m_err, m_token, m_tokenType, parseLevel1(), and parseVar().
Referenced by parseLevel2().
|
private |
Definition at line 233 of file condparser.cpp.
References evalVariable(), FALSE, 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 CondParser(), 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 CondParser(), getToken(), parse(), parseLevel3(), and parseVar().