My Project
Main Page
Modules
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Groups
Pages
condparser.h
Go to the documentation of this file.
1
#ifndef CONDPARSER_H
2
#define CONDPARSER_H
3
25
#include <qcstring.h>
26
27
class
CondParser
28
{
29
// public functions
30
public
:
31
CondParser
() :
m_e
(0),
m_tokenType
(
NOTHING
) {}
32
bool
parse
(
const
char
*fileName,
int
lineNr,
const
char
*expr);
33
34
// enumerations
35
private
:
36
enum
TOKENTYPE
37
{
38
NOTHING
= -1,
39
DELIMITER
,
40
VARIABLE
,
41
UNKNOWN
42
};
43
enum
OPERATOR_ID
44
{
45
UNKNOWN_OP
= -1,
46
AND
= 1,
47
OR
,
48
NOT
49
};
50
51
// data
52
private
:
53
54
QCString
m_err
;
55
QCString
m_expr
;
56
const
char
*
m_e
;
57
58
QCString
m_token
;
59
TOKENTYPE
m_tokenType
;
60
61
// private functions
62
private
:
63
void
getToken
();
64
65
bool
parseLevel1
();
66
bool
parseLevel2
();
67
bool
parseLevel3
();
68
bool
parseVar
();
69
70
bool
evalOperator
(
const
int
opId,
bool
lhs,
bool
rhs);
71
bool
evalVariable
(
const
char
*
varName
);
72
int
getOperatorId
(
const
QCString &opName);
73
};
74
75
#endif
76