31 lines
737 B
C
31 lines
737 B
C
|
|
#ifndef APFL_SCOPE_H
|
||
|
|
#define APFL_SCOPE_H
|
||
|
|
|
||
|
|
#ifdef __cplusplus
|
||
|
|
extern "C" {
|
||
|
|
#endif
|
||
|
|
|
||
|
|
#include "gc.h"
|
||
|
|
#include "hashmap.h"
|
||
|
|
#include "value.h"
|
||
|
|
|
||
|
|
struct scope {
|
||
|
|
struct apfl_hashmap map;
|
||
|
|
};
|
||
|
|
|
||
|
|
struct scope *apfl_scope_new(struct gc *);
|
||
|
|
void apfl_scope_deinit(struct apfl_allocator, struct scope *);
|
||
|
|
|
||
|
|
bool apfl_scope_get(struct scope *, struct apfl_string *name, struct apfl_value *out);
|
||
|
|
bool apfl_scope_set(struct gc *, struct scope *, struct apfl_string *name, struct apfl_value value);
|
||
|
|
bool apfl_scope_create_var(struct gc *, struct scope *, struct apfl_string *name);
|
||
|
|
|
||
|
|
void apfl_gc_var_traverse(struct apfl_value *, gc_visitor, void *);
|
||
|
|
void apfl_gc_scope_traverse(struct scope *, gc_visitor, void *);
|
||
|
|
|
||
|
|
#ifdef __cplusplus
|
||
|
|
}
|
||
|
|
#endif
|
||
|
|
|
||
|
|
#endif
|