ARGoS  3
A parallel, multi-engine simulator for swarm robotics
plugins/simulator/visualizations/qt-opengl/qtopengl_lua_syntax_highlighter.h
Go to the documentation of this file.
00001 
00007 #ifndef QTOPENGL_LUA_SYNTAX_HIGHLIGHTER_H
00008 #define QTOPENGL_LUA_SYNTAX_HIGHLIGHTER_H
00009 
00010 namespace argos {
00011    class CQTOpenGLLuaSyntaxHighlighter;
00012 }
00013 
00014 #include <QHash>
00015 #include <QSyntaxHighlighter>
00016 #include <QTextCharFormat>
00017 
00018 class QTextDocument;
00019 
00020 namespace argos {
00021 
00022    class CQTOpenGLLuaSyntaxHighlighter : public QSyntaxHighlighter {
00023 
00024       Q_OBJECT
00025 
00026    public:
00027 
00028       CQTOpenGLLuaSyntaxHighlighter(QTextDocument* pc_text);
00029       virtual ~CQTOpenGLLuaSyntaxHighlighter() {}
00030 
00031    protected:
00032 
00033       void highlightBlock(const QString& str_text);
00034 
00035    private:
00036       
00037       struct SHighlightingRule
00038       {
00039          QRegExp Pattern;
00040          QTextCharFormat Format;
00041       };
00042       QVector<SHighlightingRule> m_vecHighlightingRules;
00043 
00044       QRegExp m_cCommentStartExpression;
00045       QRegExp m_cCommentEndExpression;
00046 
00047       QTextCharFormat m_cKeywordFormat;
00048       QTextCharFormat m_cSingleLineCommentFormat;
00049       QTextCharFormat m_cMultiLineCommentFormat;
00050       QTextCharFormat m_cQuotationFormat;
00051       QTextCharFormat m_cFunctionFormat;
00052    };
00053 
00054 }
00055 
00056 #endif