1234567891011121314151617181920212223242526272829303132333435363738394041424344454647 |
- #ifndef STRINGINTMAP_H
- #define STRINGINTMAP_H
- #ifdef __cplusplus
- extern "C" {
- #endif
- #include <stdbool.h>
- #include "DataType.h"
- typedef struct {
- int address;
- int entries;
- int scope;
- } Scope;
- typedef struct {
- const char* name;
- DataType type;
- int address;
- } Variable;
- typedef struct {
- int capacity;
- int entries;
- int address;
- int scope;
- Variable* data;
- int maxAddress;
- } Variables;
- void vsInit(Variables* v);
- void vsDelete(Variables* v);
- bool vsSearch(const Variables* vs, Variable* v, const char* s);
- bool vSearchStruct(Variable* v, Structs* sts, Struct* st, const char* s);
- bool vsInScope(const Variables* vs, const char* s);
- Variable* vsAdd(Variables* v, const char* s, DataType type, Structs* sts);
- void vsReset(Variables* v);
- void vsEnterScope(Variables* v, Scope* s);
- void vsLeaveScope(Variables* v, Scope* s);
- #ifdef __cplusplus
- }
- #endif
- #endif
|