Operation.h 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. #ifndef OPERATION_H
  2. #define OPERATION_H
  3. #define NUMBER_OPERATION(name) OP_##name##_INT, OP_##name##_FLOAT
  4. #define TYPE_OPERATION(name) \
  5. OP_##name##_INT, OP_##name##_FLOAT, OP_##name##_BOOL
  6. typedef enum Operation {
  7. OP_NOTHING,
  8. NUMBER_OPERATION(PUSH),
  9. OP_PUSH_TRUE,
  10. OP_PUSH_FALSE,
  11. NUMBER_OPERATION(ADD),
  12. NUMBER_OPERATION(SUB),
  13. NUMBER_OPERATION(MUL),
  14. NUMBER_OPERATION(DIV),
  15. OP_MOD_INT,
  16. NUMBER_OPERATION(INVERT_SIGN),
  17. NUMBER_OPERATION(LESS),
  18. NUMBER_OPERATION(GREATER),
  19. NUMBER_OPERATION(EQUAL),
  20. OP_EQUAL_BOOL,
  21. OP_NOT,
  22. OP_AND,
  23. OP_OR,
  24. OP_BIT_NOT,
  25. OP_BIT_AND,
  26. OP_BIT_OR,
  27. OP_BIT_XOR,
  28. OP_LEFT_SHIFT,
  29. OP_RIGHT_SHIFT,
  30. TYPE_OPERATION(PRINT),
  31. OP_LINE,
  32. OP_GOTO,
  33. OP_IF_GOTO,
  34. OP_PEEK_FALSE_GOTO,
  35. OP_PEEK_TRUE_GOTO,
  36. OP_GOSUB,
  37. OP_RETURN,
  38. TYPE_OPERATION(RETURN),
  39. OP_RESERVE,
  40. TYPE_OPERATION(LOAD),
  41. TYPE_OPERATION(STORE),
  42. OP_INT_ARRAY,
  43. OP_STORE_ARRAY
  44. } Operation;
  45. #endif