diff --git a/SLS_C/include/sls/interpreter.h b/SLS_C/include/sls/interpreter.h index 8a8b3d6..a07a79a 100644 --- a/SLS_C/include/sls/interpreter.h +++ b/SLS_C/include/sls/interpreter.h @@ -8,6 +8,8 @@ #include +#include "sls/lexer.h" + typedef enum { STACK_IDENTIFIER, STACK_I64, @@ -23,9 +25,35 @@ typedef enum { STACK_CHARACTER, STACK_BOOLEAN, STACK_TOKEN_STRING, -} StackTypes; +} StackType; extern const char *STACK_TYPES_NAMES[]; extern const size_t STACK_TYPE_COUNT; +typedef struct StackItem { + StackType type; + union { + Identifier identifier; + int64_t i64; + int32_t i32; + int16_t i16; + int8_t i8; + uint64_t u64; + uint32_t u32; + uint16_t u16; + uint8_t u8; + float f32; + double f64; + char character; + Boolean boolean; + TokenString token_string; + }; + StackItem *next; +} StackItem; + +typedef struct { + StackItem *stack; + +} InterpreterState; + #endif // SLS_INTERPRETER_H