-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmiblexer.h
54 lines (44 loc) · 910 Bytes
/
miblexer.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#ifndef MIBLEXER_H
#define MIBLEXER_H
#include <QObject>
#include <qscilexercustom.h>
class QsciStyle;
class MibLexer : public QsciLexerCustom {
Q_OBJECT
public:
enum {
Default = 0,
String,
Keyword,
Type,
Access,
Comment,
OID,
MaxStyle
};
MibLexer(QObject *parent = 0);
~MibLexer();
const char *language() const;
QString description(int) const;
void styleText(int start, int end);
bool pushStyle(int style);
bool popStyle();
int getStyle();
bool hasStyle(int);
void resetStyle();
private:
QMap<int,QString> styleNames;
#define declareStyle(style,color, paper, font) styleNames[style] = tr(#style); \
setColor(color, style); \
setPaper(paper, style); \
setFont(font, style);
QList<int> styleStack;
QStringList keywords;
QStringList accesses;
QStringList types;
void initKeywords();
void initAccesses();
void initTypes();
void styleLine(QString);
};
#endif