kumiranalizerplugin.h 2.02 KB
Newer Older
victor's avatar
 
victor committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
#ifndef KUMIRANALIZERPLUGIN_H
#define KUMIRANALIZERPLUGIN_H

#include <extensionsystem/kplugin.h>
#include <interfaces/analizerinterface.h>

#include <QtCore/QLocale>

namespace KumirAnalizer {

class Analizer;

class KumirAnalizerPlugin
        : public ExtensionSystem::KPlugin
        , public Shared::AnalizerInterface

{
    Q_OBJECT
victor's avatar
 
victor committed
19
    Q_INTERFACES(Shared::AnalizerInterface)
20
    friend struct AnalizerPrivate;
victor's avatar
 
victor committed
21 22 23 24
public:
    KumirAnalizerPlugin();
    ~KumirAnalizerPlugin();

victor's avatar
 
victor committed
25 26 27 28
    inline bool primaryAlphabetIsLatin() const { return false; }
    inline bool caseInsensitiveGrammatic() const { return false; }
    inline bool supportPartialCompiling() const { return true; }

victor's avatar
 
victor committed
29 30
    int newDocument();
    void dropDocument(int documentId);
31
    void setSourceDirName(int documentId, const QString &dirPath);
victor's avatar
 
victor committed
32
    void setSourceText(int documentId, const QString &text);
victor's avatar
 
victor committed
33 34
    void setHiddenText(int documentId, const QString &text, int baseLine);
    void setHiddenTextBaseLine(int documentId, int baseLine);
victor's avatar
 
victor committed
35
    void changeSourceText(int documentId, const QList<Shared::ChangeTextTransaction> & changes);
victor's avatar
 
victor committed
36
    std::string rawSourceData(int documentId) const;
victor's avatar
 
victor committed
37
    Shared::LineProp lineProp(int documentId, const QString & text) const;
victor's avatar
 
victor committed
38 39
    QList<Shared::Error> errors(int documentId) const;
    QList<Shared::LineProp> lineProperties(int documentId) const;
victor's avatar
 
victor committed
40
    QList<QPoint> lineRanks(int documentId) const;
victor's avatar
 
victor committed
41
    QStringList imports(int documentId) const;
victor's avatar
 
victor committed
42
    const AST::Data * abstractSyntaxTree(int documentId) const;
victor's avatar
 
victor committed
43 44 45
    QStringList algorhitmsAvailableFor(int documentId, int lineNo) const;
    QStringList globalsAvailableFor(int documentId, int lineNo) const;
    QStringList localsAvailableFor(int documentId, int lineNo) const;
victor's avatar
 
victor committed
46 47 48 49
    inline virtual QList<QRegExp> supportedFileNamePattern() const {
        return QList<QRegExp>()
                << QRegExp("*.kum",Qt::CaseInsensitive,QRegExp::Wildcard);
    }
victor's avatar
 
victor committed
50 51 52 53 54 55 56 57 58 59 60 61

protected:
    QString initialize(const QStringList &arguments);
    void start();
    void stop();
private:
    QVector<Analizer*> m_analizers;
};

}

#endif