123456789101112131415161718192021222324252627282930313233343536373839 |
- #ifndef STRINGINTMAP_H
- #define STRINGINTMAP_H
- #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);
- #endif
|