33 lines
439 B
C
33 lines
439 B
C
#ifndef SK_VALUE_H
|
|
#define SK_VALUE_H
|
|
|
|
#include "commons.h"
|
|
#include "node.h"
|
|
|
|
#define TYPE_KIND(G) \
|
|
G(TYPE_INT)
|
|
|
|
SK_ENUM_H(TypeKind, TYPE_KIND);
|
|
|
|
union val
|
|
{
|
|
int integer;
|
|
};
|
|
|
|
struct value
|
|
{
|
|
TypeKind type;
|
|
union val val;
|
|
};
|
|
|
|
void value_init(struct value* self,
|
|
TypeKind type,
|
|
union val val);
|
|
|
|
void value_free(struct value* self);
|
|
|
|
void value_str(struct value* self, struct str* dest);
|
|
|
|
#endif
|
|
|