12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485 |
- #ifndef OPERATION_H
- #define OPERATION_H
- #ifdef __cplusplus
- extern "C" {
- #endif
- #define OP_INTEGRAL(TYPE) OP_##TYPE##_INT32, OP_##TYPE##_INT64
- #define OP_NUMBER(TYPE) OP_INTEGRAL(TYPE), OP_##TYPE##_FLOAT
- #define OP_TYPE(TYPE) OP_NUMBER(TYPE), OP_##TYPE##_BOOL
- #define OP_CHANGE_NUMBER(TYPE) \
- OP_PUSH_PRE_##TYPE##_CHANGE, OP_PUSH_POST_##TYPE##_CHANGE, \
- OP_##TYPE##_CHANGE
- typedef enum Operation {
- OP_NOTHING,
- OP_NUMBER(PUSH),
- OP_PUSH_TRUE,
- OP_PUSH_FALSE,
- OP_PUSH_NULLPTR,
- OP_PUSH_TEXT,
- OP_NUMBER(ADD),
- OP_NUMBER(SUB),
- OP_NUMBER(MUL),
- OP_NUMBER(DIV),
- OP_MOD_INT32,
- OP_MOD_INT64,
- OP_NUMBER(INVERT_SIGN),
- OP_NUMBER(LESS),
- OP_NUMBER(LESS_EQUAL),
- OP_NUMBER(GREATER),
- OP_NUMBER(GREATER_EQUAL),
- OP_TYPE(EQUAL),
- OP_TYPE(NOT_EQUAL),
- OP_EQUAL_POINTER,
- OP_NOT_EQUAL_POINTER,
- OP_NOT,
- OP_AND,
- OP_OR,
- OP_INTEGRAL(BIT_NOT),
- OP_INTEGRAL(BIT_AND),
- OP_INTEGRAL(BIT_OR),
- OP_INTEGRAL(BIT_XOR),
- OP_INTEGRAL(LEFT_SHIFT),
- OP_INTEGRAL(RIGHT_SHIFT),
- OP_LINE,
- OP_GOTO,
- OP_IF_GOTO,
- OP_PEEK_FALSE_GOTO,
- OP_PEEK_TRUE_GOTO,
- OP_GOSUB,
- OP_RETURN,
- OP_TYPE(RETURN),
- OP_RETURN_POINTER,
- OP_RESERVE,
- OP_GRESERVE,
- OP_LOAD,
- OP_TYPE(LOAD),
- OP_TYPE(STORE),
- OP_DEREFERENCE_VAR,
- OP_DEREFERENCE_GVAR,
- OP_REFERENCE,
- OP_DUPLICATE_REFERENCE,
- OP_ADD_REFERENCE,
- OP_NEW,
- OP_DELETE,
- OP_LENGTH,
- OP_STORE_POINTER,
- OP_INTEGRAL(PUSH_PRE_CHANGE),
- OP_INTEGRAL(PUSH_POST_CHANGE),
- OP_INTEGRAL(CHANGE),
- OP_FLOAT_TO_INT32,
- OP_INT32_TO_FLOAT,
- OP_INT32_TO_INT64,
- OP_INT64_TO_INT32,
- OP_FLOAT_TO_INT64,
- OP_INT64_TO_FLOAT,
- OP_CALL
- } Operation;
- #ifdef __cplusplus
- }
- #endif
- #endif
|