#ifndef STORYTOOL_H
#define STORYTOOL_H

#include "SyntaxBase.h"
#include "libParse.h"
#include "parsechecks.h"

#include <QFileInfo>

namespace MakeTools {
    /**
     * @brief 构建机制
     */
    class LIBPARSE_EXPORT StoryTool
    {
    public:
        StoryTool();

        QList<QString> compile(const QFileInfo &file, const QString &doc_name);
        QList<QString> compileSource(const QFileInfo &file, const QString &src, const QString &doc_name);

        bool checkPass(QList<Parse::ErrorMessage> &errors);
        Parse::Result::ParseCore *getCore() const;

    private:
        Parse::Result::ParseCore *const parse_core;
        CheckTools::FragmentsCheck *const fragment_check;

        bool error_check(Parse::Result::DesNode *node, QList<Parse::ErrorMessage> &err_out);
    };

}

#endif // STORYTOOL_H
