The CondParser
Class Reference
Copyright (C) 1997-2015 by Dimitri van Heesch. More...
Declaration
Included Headers
Enumerations Index
enum | TOKENTYPE { ... } |
enum | OPERATOR_ID { ... } |
Public Constructors Index
CondParser () | |
Public Member Functions Index
bool | parse (const QCString &fileName, int lineNr, const QCString &expr) |
Copyright (C) 1997-2015 by Dimitri van Heesch. More... | |
Private Member Functions Index
void | getToken () |
Get next token in the current string expr. More... | |
bool | parseLevel1 () |
conditional operators AND and OR More... | |
bool | parseLevel2 () |
NOT. More... | |
bool | parseLevel3 () |
parenthesized expression or variable More... | |
bool | parseVar () |
bool | evalOperator (const int opId, bool lhs, bool rhs) |
evaluate an operator for given values More... | |
bool | evalVariable (const QCString &varName) |
evaluate a variable More... | |
int | getOperatorId (const QCString &opName) |
returns the id of the given operator returns -1 if the operator is not recognized More... | |
Private Member Attributes Index
QCString | m_err |
error state More... | |
QCString | m_expr |
holds the expression More... | |
const char * | m_e |
points to a character in expr More... | |
QCString | m_token |
holds the token More... | |
TOKENTYPE | m_tokenType |
type of the token More... | |
Description
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.
Enumerations
OPERATOR_ID
|
Definition at line 43 of file condparser.h.
TOKENTYPE
Public Constructors
CondParser()
| inline |
Definition at line 31 of file condparser.h.
References m_e, m_tokenType and NOTHING.
Public Member Functions
parse()
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.
- Returns
-
- On error, an error message is returned.
- On success, the result of the expression is either "1" or "0".
Declaration at line 32 of file condparser.h, 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 and warn.
Referenced by handleGuard, startCondSection and startCondSection.
Private Member Functions
evalOperator()
|
evaluate an operator for given values
Declaration at line 70 of file condparser.h, definition at line 263 of file condparser.cpp.
References AND, FALSE, m_err, OR and QCString::setNum.
Referenced by parseLevel1.
evalVariable()
|
evaluate a variable
Declaration at line 71 of file condparser.h, definition at line 279 of file condparser.cpp.
References Config_getList and QCString::str.
Referenced by parseVar.
getOperatorId()
|
returns the id of the given operator returns -1 if the operator is not recognized
Declaration at line 72 of file condparser.h, definition at line 90 of file condparser.cpp.
References AND, NOT, OR and UNKNOWN_OP.
Referenced by parseLevel1 and parseLevel2.
getToken()
|
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
Declaration at line 63 of file condparser.h, definition at line 107 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.
parseLevel1()
|
conditional operators AND and OR
Declaration at line 65 of file condparser.h, definition at line 172 of file condparser.cpp.
References AND, evalOperator, getOperatorId, getToken, m_token, OR and parseLevel2.
Referenced by parse and parseLevel3.
parseLevel2()
|
NOT.
Declaration at line 66 of file condparser.h, definition at line 190 of file condparser.cpp.
References getOperatorId, getToken, m_token, NOT and parseLevel3.
Referenced by parseLevel1.
parseLevel3()
|
parenthesized expression or variable
Declaration at line 67 of file condparser.h, definition at line 208 of file condparser.cpp.
References DELIMITER, FALSE, getToken, m_err, m_token, m_tokenType, parseLevel1 and parseVar.
Referenced by parseLevel2.
parseVar()
|
Declaration at line 68 of file condparser.h, definition at line 232 of file condparser.cpp.
References evalVariable, FALSE, getToken, m_err, m_token, m_tokenType and VARIABLE.
Referenced by parseLevel3.
Private Member Attributes
m_e
|
points to a character in expr
Definition at line 56 of file condparser.h.
Referenced by CondParser, getToken and parse.
m_err
|
error state
Definition at line 54 of file condparser.h.
Referenced by evalOperator, getToken, parse, parseLevel3 and parseVar.
m_expr
|
m_token
|
holds the token
Definition at line 58 of file condparser.h.
Referenced by getToken, parse, parseLevel1, parseLevel2, parseLevel3 and parseVar.
m_tokenType
|
type of the token
Definition at line 59 of file condparser.h.
Referenced by CondParser, getToken, parse, parseLevel3 and parseVar.
The documentation for this class was generated from the following files:
Generated via doxygen2docusaurus by Doxygen 1.14.0.