STAMINA/STORM 0.1
Infinite state-space truncator which generates a probability within a window
Highlighter.h
1#ifndef STAMINA_GUI_ADDONS_HIGHLIGHTER_H
2#define STAMINA_GUI_ADDONS_HIGHLIGHTER_H
3
4#include <QSyntaxHighlighter>
5#include <QRegularExpressionMatchIterator>
6#include <QRegularExpression>
7#include <QTextDocument>
8
9#include "ColorSchemes.h"
10
11namespace stamina {
12 namespace gui {
13 namespace addons {
14 namespace highlighter {
15 class Highlighter : public QSyntaxHighlighter {
16 Q_OBJECT
17 public:
18 Highlighter(QTextDocument * parent = nullptr);
19 protected:
20 // Rules
21 virtual void setupKeyWordPatterns() = 0;
22
23 void highlightBlock(const QString & text) override;
24
26 {
27 QRegularExpression pattern;
28 QTextCharFormat format;
29 };
30 QVector<HighlightingRule> highlightingRules;
31
32 QRegularExpression commentStartExpression;
33 QRegularExpression commentEndExpression;
34
35 QTextCharFormat keywordFormat;
36 QTextCharFormat classFormat;
37 QTextCharFormat singleLineCommentFormat;
38 QTextCharFormat multiLineCommentFormat;
39 QTextCharFormat quotationFormat;
40 QTextCharFormat functionFormat;
41 QTextCharFormat numberFormat;
42 QTextCharFormat constFormat;
43 };
44 }
45 }
46 }
47}
48
49#endif // STAMINA_GUI_ADDONS_HIGHLIGHTER_H
Definition: ExplicitTruncatedModelBuilder.cpp:40