From aea40f3877e36e95f2a70e3eeb0569fd156e3841 Mon Sep 17 00:00:00 2001 From: Nakidai Date: Fri, 5 Jul 2024 07:16:05 +0300 Subject: Add almost all Only continue operation and "blocks" of code are left. Now I'm gonna sleep And yes, I understand that code need to be refactored, and if I will not get bored with writing this thing I will rewrite it in a better way, cuz now code is awful --- include/cccl.h | 21 ++++++++++----------- include/platform/getch.h | 13 +++++++++++++ include/types.h | 2 ++ 3 files changed, 25 insertions(+), 11 deletions(-) create mode 100644 include/platform/getch.h (limited to 'include') diff --git a/include/cccl.h b/include/cccl.h index 6652453..9e41730 100644 --- a/include/cccl.h +++ b/include/cccl.h @@ -5,8 +5,6 @@ #include -#include "cvector.h" - typedef struct cccl_varpair { @@ -28,15 +26,16 @@ typedef struct cccl_pointer typedef struct cccl { - cccl_varpair *variables; /* Array with variables */ - cccl_procpair *procedures; /* Array with procedures */ - i16 *stack; /* User stack */ - s8 *br_stack; /* Stack for brackets */ - i32 *ep_stack; /* Call stack */ - i32 ep; /* Pointer to current symbol */ - s8 *code; /* Code being executed */ - s8 *filename; /* File being executed */ - i32 size; /* File size */ + cccl_varpair *variables; /* Array with variables */ + cccl_procpair *procedures; /* Array with procedures */ + i16 *stack; /* User stack */ + s8 *br_stack; /* Stack for brackets */ + cccl_varpair **lv_stack; /* Local variable stack */ + cccl_pointer *ep_stack; /* Call stack */ + i32 ep; /* Pointer to current symbol */ + s8 *code; /* Code being executed */ + s8 *filename; /* File being executed */ + i32 size; /* File size */ } cccl; void cccl_init(s8 *filename); diff --git a/include/platform/getch.h b/include/platform/getch.h new file mode 100644 index 0000000..490b536 --- /dev/null +++ b/include/platform/getch.h @@ -0,0 +1,13 @@ +#ifndef __GETCH_H__ +#define __GETCH_H__ + +#ifdef _WIN32 +#include +#define getch _getche +#else +int getch(void); +#endif /* _WIN32 */ + +void getch_init(void); + +#endif /* __GETCH_H__ */ diff --git a/include/types.h b/include/types.h index 9c92d57..4bf1da9 100644 --- a/include/types.h +++ b/include/types.h @@ -9,9 +9,11 @@ typedef char s8; typedef uint8_t u8; typedef uint16_t u16; typedef uint32_t u32; +typedef uint64_t i64; typedef int8_t i8; typedef int16_t i16; typedef int32_t i32; +typedef uint64_t i64; #endif /* __TYPES_H__ */ -- cgit 1.4.1