62 lines
651 B
C
62 lines
651 B
C
|
|
#ifndef STRUCT_EXPR
|
|
#define STRUCT_EXPR
|
|
|
|
#include <stdint.h>
|
|
|
|
enum ekind
|
|
{
|
|
ek_unreachable,
|
|
|
|
ek_0,
|
|
ek_1,
|
|
ek_W,
|
|
ek_X,
|
|
ek_Y,
|
|
ek_Z,
|
|
|
|
// very special:
|
|
ek_A,
|
|
|
|
ek_not,
|
|
ek_or,
|
|
ek_and,
|
|
|
|
ek_orn,
|
|
ek_nor,
|
|
|
|
ek_andn,
|
|
ek_nand,
|
|
|
|
ek_xor,
|
|
ek_nxor,
|
|
|
|
ek_lt,
|
|
ek_lte,
|
|
ek_gt,
|
|
ek_gte,
|
|
|
|
ek_ternary,
|
|
|
|
// also very special.
|
|
// 'left' is the variable's truthtable
|
|
// to print the requested truthtable
|
|
// look a the relavent lookup.
|
|
ek_assignment,
|
|
};
|
|
|
|
struct expr
|
|
{
|
|
enum ekind kind;
|
|
|
|
uint16_t cond, left, right;
|
|
|
|
int cost;
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#endif
|