diff options
author | Bobby Bingham <koorogi@koorogi.info> | 2017-01-18 19:40:18 -0600 |
---|---|---|
committer | Bobby Bingham <koorogi@koorogi.info> | 2017-01-18 19:40:18 -0600 |
commit | 6c6b91f9a6bc5ae203e99ac7abb3a70215488a6f (patch) | |
tree | a60ee21b204363128001cf323e5914745a630afd /nqasm.h | |
parent | 1e0d0202e614f398f491624c84ae9a8309fa2f96 (diff) |
nqasm: support unary operators in immediate expressions
Diffstat (limited to 'nqasm.h')
-rw-r--r-- | nqasm.h | 16 |
1 files changed, 13 insertions, 3 deletions
@@ -1,15 +1,23 @@ #ifndef NQ_NQASM_H #define NQ_NQASM_H -#define ARG_INTEGER 0 -#define ARG_LABEL 1 -#define ARG_PC 2 +enum { + ARG_INTEGER, + ARG_LABEL, + ARG_PC, + + ARG_UNARY_ADD, + ARG_UNARY_SUB, + ARG_UNARY_NOT, + ARG_UNARY_INV, +}; struct argument { int type; union { long value; char *label; + const struct argument *children[1]; }; }; @@ -25,5 +33,7 @@ struct instruction { void add_instruction(const struct instruction *); void add_label(const char *); +struct argument *argdup(const struct argument *); + #endif |