26 lines
398 B
C
26 lines
398 B
C
#ifndef INTERPRETER_H
|
|
#define INTERPRETER_H
|
|
|
|
#include "expr.h"
|
|
#include "token.h"
|
|
|
|
typedef enum {
|
|
INS_STRING,
|
|
INS_DOUBLE,
|
|
INS_BOOLEAN,
|
|
INS_NULL
|
|
} ObjectInstanceType;
|
|
|
|
typedef struct Object {
|
|
ObjectInstanceType instance;
|
|
union {
|
|
char* string;
|
|
double number;
|
|
int boolean;
|
|
} value;
|
|
} Object;
|
|
|
|
void Interpret(Expr*);
|
|
void FreeObject(Object*);
|
|
|
|
#endif |