diff options
| author | Nakidai <plaza521@inbox.ru> | 2024-07-05 07:16:05 +0300 |
|---|---|---|
| committer | Nakidai <plaza521@inbox.ru> | 2024-07-05 07:19:48 +0300 |
| commit | aea40f3877e36e95f2a70e3eeb0569fd156e3841 (patch) | |
| tree | e6bd202ac4e5499db3b9983fc46e3b880a20f5ff /include | |
| parent | a9c159f5f7bf3479c3236735960597b4bc36a204 (diff) | |
| download | 3cl-aea40f3877e36e95f2a70e3eeb0569fd156e3841.tar.gz 3cl-aea40f3877e36e95f2a70e3eeb0569fd156e3841.zip | |
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
Diffstat (limited to 'include')
| -rw-r--r-- | include/cccl.h | 21 | ||||
| -rw-r--r-- | include/platform/getch.h | 13 | ||||
| -rw-r--r-- | include/types.h | 2 |
3 files changed, 25 insertions, 11 deletions
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 <stdbool.h> -#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 <conio.h> +#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__ */ |