adding experimental changes for compiler enhancement

This commit is contained in:
2020-09-24 08:24:47 +00:00
parent b8fd5c6712
commit b9ae46afff
3 changed files with 136 additions and 56 deletions

View File

@ -1091,25 +1091,35 @@ typedef struct hcl_compiler_t hcl_compiler_t;
#define HCL_ERRMSG_CAPA (2048)
typedef struct hcl_code_container_t hcl_code_container_t;
struct hcl_code_container_t
typedef struct hcl_clv_t hcl_clv_t;
struct hcl_clv_t /* literal value in compiler */
{
int type; /* int, string, byte string, character, etc */
hcl_oow_t size;
/* data is placed here */
};
typedef struct hcl_ccl_t hcl_ccl_t;
struct hcl_ccl_t /* code and literal in compiler */
{
struct
{
hcl_oop_byte_t arr; /* byte code array - not part of object memory */
hcl_uint8_t* ptr;
hcl_oow_t capa;
hcl_oow_t len;
} bc;
struct
{
hcl_oop_oop_t arr; /* literal array - not part of object memory */
hcl_clv_t* ptr;
hcl_oow_t capa;
hcl_oow_t len;
} lit;
hcl_code_container_t* _par;
hcl_oow_t pindex;
};
struct hcl_t
{
hcl_oow_t _instsize;
@ -1260,8 +1270,28 @@ struct hcl_t
} xbuf; /* buffer to support sprintf */
} sprintf;
hcl_code_container_t* ccstk; /* byte-code container stack */
hcl_code_container_t code; /* byte-code structure generated by compilers */
struct
{
hcl_ccl_t* ptr;
hcl_oow_t capa;
hcl_oow_t len;
hcl_oow_t index;
} ccl;
struct
{
struct
{
hcl_oop_byte_t arr; /* byte code array - not part of object memory */
hcl_oow_t len;
} bc;
struct
{
hcl_oop_oop_t arr; /* literal array - not part of object memory */
hcl_oow_t len;
} lit;
} code;
/* == PRINTER == */
struct