blob: e7a4b3d5216e607a1063c777a027724b74b39af3 [file] [log] [blame]
#pragma once
#include <QObject>
#include <QThread>
#include <QQueue>
#include "Cell.h"
#include "../Token.h"
#include "../Evaluator.h"
#include "../Parser.h"
class NbRuntime : public QObject
{
Q_OBJECT
public:
explicit NbRuntime(QObject *parent = nullptr);
public slots:
void queueCell(Cell *cell);
void unqueueCell(Cell *cell);
signals:
void cellFinishedRunning(Cell *cell, RuntimeResult result);
void cellFailedToParse(Cell *cell, ParseResult result, Parser parser);
void cellWaiting(Cell *cell);
void cellRunning(Cell *cell);
void cellQuit(Cell *cell);
protected:
void evalRemaining();
Evaluator _eval;
QQueue<Cell *> _cells;
Cell *_running = nullptr;
VarContext _ctx;
};