diff options
Diffstat (limited to 'scope.h')
| -rw-r--r-- | scope.h | 31 |
1 files changed, 21 insertions, 10 deletions
@@ -7,6 +7,8 @@ struct storage_location { STO_LABEL, STO_STACK, STO_IMM, + /* I would like to solve functions using the type system + * and kill STO_FN and STO_UNRESOLVED in favor of STO_LABEL. */ STO_FN, STO_UNRESOLVED, } type; @@ -19,17 +21,24 @@ struct storage_location { }; }; +struct type_key { + char* name; + unsigned char how_long; + bool marked_unsigned; + bool marked_signed; +}; + struct type_def { - const char* name; - unsigned long long sz; - bool is_primitive; + struct type_key key; bool is_signed; + bool is_floating; + unsigned long long sz; }; struct var_def { - const char* name; + char* name; struct storage_location loc; - unsigned long long sz; + const struct type_def* resolved_type; }; struct scope { @@ -51,13 +60,15 @@ void scope_destroy(struct scope* scope); void scope_install_default_types(struct scope* scope); bool scope_get_type( const struct scope* scope, - struct type_def* p_entry, - const char* name); -void scope_define_type(struct scope* scope, struct type_def type); + const struct type_def** p_entry, + const struct type_key* key); +const struct type_def* scope_define_type( + struct scope* scope, + struct type_def type); bool scope_get_var( const struct scope* scope, - struct var_def* p_entry, + struct var_def** p_entry, const char* name); -void scope_define_var(struct scope* scope, struct var_def var); +struct var_def* scope_define_var(struct scope* scope, struct var_def var); #endif
\ No newline at end of file |
