1234567891011121314151617181920212223242526272829303132333435363738 |
- #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 vInit(Variables* v);
- void vDelete(Variables* v);
- Variable* vSearch(Variables* v, const char* s);
- Variable* vSearchScope(Variables* v, const char* s);
- Variable* vAdd(Variables* v, const char* s, DataType type);
- void vReset(Variables* v);
- void vEnterScope(Variables* v, Scope* s);
- void vLeaveScope(Variables* v, Scope* s);
- #endif
|