31 lines
705 B
C
31 lines
705 B
C
#ifndef CCM_VALUE_H
|
|
#define CCM_VALUE_H
|
|
|
|
#include "commons.h"
|
|
#include "type.h"
|
|
#include "vec.h"
|
|
|
|
typedef struct {
|
|
union {
|
|
double num;
|
|
vec_t* tuple;
|
|
int boolean;
|
|
char* str;
|
|
} data;
|
|
|
|
Type type;
|
|
int line;
|
|
} value_t;
|
|
|
|
void value_init_num(value_t* self, double num, int line);
|
|
void value_init_new_tuple(value_t* self, vec_t* values, int line);
|
|
void value_init_boolean(value_t* self, int boolean, int line);
|
|
void value_init_str(value_t* self, char const* value, int line);
|
|
value_t* value_new_clone(value_t* self);
|
|
void value_free(value_t* self);
|
|
|
|
size_t value_str(value_t* self, char* buffer, size_t size);
|
|
int value_equals(value_t* self, value_t* rhs);
|
|
|
|
#endif
|