Code.h 459 B

123456789101112131415161718192021222324
  1. #ifndef BASIC_CODE_H
  2. #define BASIC_CODE_H
  3. #include "Constants.h"
  4. typedef enum : u8 {
  5. ADD,
  6. PUSH_CONSTANT_STRING,
  7. PUSH_INT,
  8. PRINT,
  9. STOP
  10. } Instruction;
  11. [[nodiscard]] bool pushInstruction(Instruction i);
  12. [[nodiscard]] bool pushI64(i64 i);
  13. [[nodiscard]] bool pushSize(size_t i);
  14. [[nodiscard]] bool pushConstantString(const char* c);
  15. Instruction readInstruction();
  16. i64 readI64();
  17. size_t readSize();
  18. const char* readConstantString();
  19. #endif