| 12345678910111213141516171819202122232425262728293031323334 |
- #ifndef SYNTAXHIGHLIGHTER_H
- #define SYNTAXHIGHLIGHTER_H
- #include <QSyntaxHighlighter>
- class SyntaxHighlighter : public QSyntaxHighlighter
- {
- Q_OBJECT
- public:
- SyntaxHighlighter(QTextDocument *parent = 0);
- protected:
- void highlightBlock(const QString &text) Q_DECL_OVERRIDE;
- private:
- struct HighlightingRule
- {
- QRegExp pattern;
- QTextCharFormat format;
- };
- QVector<HighlightingRule> highlightingRules;
- QRegExp commentStartExpression;
- QRegExp commentEndExpression;
- QTextCharFormat instructionFormat;
- QTextCharFormat variableFormat;
- QTextCharFormat bankFormat;
- QTextCharFormat singleLineCommentFormat;
- QTextCharFormat multiLineCommentFormat;
- };
- #endif // SYNTAXHIGHLIGHTER_H
|