13#ifndef NSBACI_SERVICES_RUNTIME_NSBACI_INTERPRETER_H
14#define NSBACI_SERVICES_RUNTIME_NSBACI_INTERPRETER_H
31class NsbaciInterpreter final :
public Interpreter {
33 NsbaciInterpreter() =
default;
34 ~NsbaciInterpreter()
override =
default;
49 void reset()
override;
54 bool waitingForInput =
false;
55 std::string pendingInput;
56 bool hasInput =
false;
59 uint8_t currentR = 0, currentG = 0, currentB = 0, currentA = 255;
60 int32_t currentLineWidth = 1;
InterpreterResult executeInstruction(Thread &t, Program &program) override
Executes the current instruction for the given thread with the program context.
Definition nsbaciInterpreter.cpp:16
void reset() override
Reset interpreter state for a new run.
Definition nsbaciInterpreter.cpp:764
void setDrawingCallback(DrawingCallback callback) override
Set the drawing callback for drawing operations.
Definition nsbaciInterpreter.cpp:760
void setOutputCallback(OutputCallback callback) override
Set the output callback for print operations.
Definition nsbaciInterpreter.cpp:756
void provideInput(const std::string &input) override
Provide input to a thread waiting for input.
Definition nsbaciInterpreter.cpp:749
bool isWaitingForInput() const override
Check if interpreter is waiting for input.
Definition nsbaciInterpreter.cpp:754
Represents a compiled program ready for execution.
Definition program.h:54
Represents a thread in the runtime service.
Definition thread.h:31
Interpreter class declaration for nsbaci runtime service.
Runtime services namespace for nsbaci.
std::function< void(const std::string &)> OutputCallback
Callback type for output operations.
Definition interpreter.h:62
std::function< void(const nsbaci::types::DrawCommand &)> DrawingCallback
Callback type for drawing operations.
Definition interpreter.h:68
Definition interpreter.h:25