#pragma once
#include <lookup_table.h>

/*
 * This enumeration defines all monops
 */
typedef enum
{
    MO_not,
    MO_neg,
    MO_unknown
} monop;

/*
 * This enumeration defines all binops
 */
typedef enum
{
    BO_add     = 1,
    BO_sub     = 2,
    BO_mul     = 4,
    BO_div     = 8,
    BO_mod     = 16,
    BO_lt      = 32,
    BO_le      = 64,
    BO_gt      = 128,
    BO_ge      = 256,
    BO_eq      = 512,
    BO_ne      = 1024,
    BO_and     = 2048,
    BO_or      = 4096,
    BO_unknown = 0,
    _BO_arith  = BO_add | BO_sub | BO_mul | BO_div | BO_mod,
    _BO_log    = BO_and | BO_or,
    _BO_rel    = BO_lt | BO_le | BO_gt | BO_ge | BO_eq | BO_ne
} binop;

typedef enum
{
    TY_unknown = 0,
    TY_int = 1,
    TY_bool = 2,
    TY_float = 4,
    TY_void = 8,
    TY_arr = 16,
    TY_const = 32
} type_t;


union cp_val
{
    int ival;
    float fval;
};

struct cp_link
{
    struct cp_link* next;
    type_t type;
    union cp_val;
};

/* Elements of the import/export table queue, this contains a symbol that needs
 * to be in the import or export table. */
struct ie_item
{
    struct ie_item* next;
    struct st_entry* entry;
};