mirror of
https://github.com/usatiuk/psil.git
synced 2025-10-29 03:07:49 +01:00
stratom numatom
This commit is contained in:
@@ -7,9 +7,12 @@
|
||||
|
||||
#include <cassert>
|
||||
#include <cstdint>
|
||||
#include <string>
|
||||
#include <utility>
|
||||
|
||||
enum class CellType {
|
||||
INT,
|
||||
NUMATOM,
|
||||
STRATOM,
|
||||
CONS
|
||||
};
|
||||
|
||||
@@ -23,13 +26,20 @@ struct Cell {
|
||||
bool live = false;
|
||||
};
|
||||
|
||||
struct ValueCell : public Cell {
|
||||
ValueCell() = delete;
|
||||
explicit ValueCell(CellValType val) : Cell(CellType::INT), _val(val) {}
|
||||
struct NumAtomCell : public Cell {
|
||||
NumAtomCell() = delete;
|
||||
explicit NumAtomCell(CellValType val) : Cell(CellType::NUMATOM), _val(val) {}
|
||||
|
||||
CellValType _val;
|
||||
};
|
||||
|
||||
struct StrAtomCell : public Cell {
|
||||
StrAtomCell() = delete;
|
||||
explicit StrAtomCell(std::string val) : Cell(CellType::STRATOM), _val(std::move(val)) {}
|
||||
|
||||
std::string _val;
|
||||
};
|
||||
|
||||
struct ConsCell : public Cell {
|
||||
ConsCell() : Cell(CellType::CONS) {}
|
||||
explicit ConsCell(Cell *car) : Cell(CellType::CONS), _car(car) {}
|
||||
|
||||
Reference in New Issue
Block a user