analizerinterface.h 1.9 KB
Newer Older
victor's avatar
 
victor committed
1 2 3 4 5
#ifndef ANALIZER_INTERFACE_H
#define ANALIZER_INTERFACE_H

#include "error.h"
#include "lineprop.h"
victor's avatar
 
victor committed
6
#include "dataformats/ast.h"
victor's avatar
 
victor committed
7

victor's avatar
 
victor committed
8 9
#include <QtCore>

victor's avatar
 
victor committed
10 11
namespace Shared {

victor's avatar
 
victor committed
12 13 14 15 16
struct ChangeTextTransaction {
    QSet<int> removedLineNumbers;
    QStringList newLines;
};

victor's avatar
 
victor committed
17 18 19
class AnalizerInterface {
public:
    virtual int newDocument() = 0;
victor's avatar
 
victor committed
20 21 22
    virtual bool primaryAlphabetIsLatin() const = 0;
    virtual bool caseInsensitiveGrammatic() const = 0;
    virtual bool supportPartialCompiling() const = 0;
victor's avatar
 
victor committed
23
    virtual void dropDocument(int documentId) = 0;
24
    virtual void setSourceDirName(int documentId, const QString & dirPath) = 0;
victor's avatar
 
victor committed
25
    virtual void setSourceText(int documentId, const QString &text) = 0;
victor's avatar
 
victor committed
26 27
    virtual void setHiddenText(int documentId, const QString &text, int baseLine) = 0;
    virtual void setHiddenTextBaseLine(int documentId, int baseLine) = 0;
victor's avatar
 
victor committed
28
    virtual void changeSourceText(int documentId, const QList<ChangeTextTransaction> & changes) = 0;
victor's avatar
 
victor committed
29 30
    virtual QList<Error> errors(int documentId) const = 0;
    virtual QList<LineProp> lineProperties(int documentId) const = 0;
victor's avatar
 
victor committed
31
    virtual QList<QPoint> lineRanks(int documentId) const = 0;
victor's avatar
 
victor committed
32
    virtual QStringList imports(int documentId) const = 0;
victor's avatar
 
victor committed
33
    virtual const AST::Data * abstractSyntaxTree(int documentId) const = 0;
victor's avatar
 
victor committed
34
    virtual LineProp lineProp(int documentId, const QString & text) const = 0;
victor's avatar
 
victor committed
35 36 37
    virtual QStringList algorhitmsAvailableFor(int documentId, int lineNo) const = 0;
    virtual QStringList globalsAvailableFor(int documentId, int lineNo) const = 0;
    virtual QStringList localsAvailableFor(int documentId, int lineNo) const = 0;
victor's avatar
 
victor committed
38
    virtual std::string rawSourceData(int documentId) const = 0;
victor's avatar
 
victor committed
39 40 41 42
    inline virtual QList<QRegExp> supportedFileNamePattern() const {
        return QList<QRegExp>()
                << QRegExp("*",Qt::CaseInsensitive,QRegExp::Wildcard);
    }
victor's avatar
 
victor committed
43 44 45 46
};

}

victor's avatar
 
victor committed
47 48
Q_DECLARE_INTERFACE(Shared::AnalizerInterface, "kumir2.Analizer");

victor's avatar
 
victor committed
49
#endif