feat(furvm): introduce module, instruction and constant

This commit is contained in:
2026-06-05 17:55:40 +02:00
parent 2f9328d85a
commit 66fdd1dc9c
7 changed files with 337 additions and 5 deletions
+74
View File
@@ -0,0 +1,74 @@
#ifndef FURVM_FWD_HPP
#define FURVM_FWD_HPP
#include <cstddef> // IWYU pragma: export
#include <cstdint> // IWYU pragma: export
/**
* @brief Furlang's virtual machine.
*/
namespace furvm {
// constant.hpp
/**
* @brief Constant index.
*
* An index to the constant in module's constant pool.
*/
using constant_index = std::uint16_t;
/**
* @enum constant_t
* @brief Constant type.
*/
enum class constant_t : std::uint8_t;
/**
* @class constant
* @brief Constant.
*/
class constant;
// instruction.hpp
/**
* @enum instruction_t
* @brief Furvm's instruction type.
*/
enum class instruction_t : std::uint8_t;
/**
* @struct instruction
* @brief Furvm's instruction.
*/
struct instruction;
// module.hpp
/**
* @class mod
* @brief Module.
*
* A furvm module. Translation unit of furlang.
*/
class mod;
/**
* @brief Furvm module's index.
*/
using module_index = std::size_t;
// context.hpp
/**
* @class context
* @brief Context.
*
* A furvm context.
*/
class context;
} // namespace furvm
#endif // FURVM_FWD_HPP