28 lines
417 B
C

#ifndef EXPRESSION_H
#define EXPRESSION_H
#include <stdbool.h>
typedef enum {
OPERATOR_ADD,
OPERATOR_SUBTRACT,
OPERATOR_MULTIPLY,
OPERATOR_DIVIDE,
} operator_t;
struct _expression_t;
typedef struct {
operator_t operator;
const struct _expression_t *operands[2];
} application_t;
typedef struct _expression_t {
bool is_number;
union {
application_t application;
int number;
};
} expression_t;
#endif