core.hpp 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. #ifndef AFUN_CORE_HPP
  2. #define AFUN_CORE_HPP
  3. #include "tool.hpp"
  4. namespace aFuncore {
  5. typedef enum CodeType {
  6. code_start = 0,
  7. code_element = 1,
  8. code_block = 2,
  9. } CodeType;
  10. typedef enum BlockType {
  11. block_p = '(',
  12. block_b = '[',
  13. block_c = '{',
  14. } BlockType;
  15. typedef class Code Code;
  16. class EnvVarSpace;
  17. class Inter;
  18. enum InterStatus {
  19. inter_creat = 0,
  20. inter_init = 1, // 执行初始化程序
  21. inter_normal = 2, // 正常执行
  22. inter_stop = 3, // 当前运算退出
  23. inter_exit = 4, // 解释器退出
  24. };
  25. typedef enum InterStatus InterStatus;
  26. typedef enum ExitFlat {
  27. ef_activity = 0, // 主动退出
  28. ef_passive = 1, // 被动退出
  29. ef_none = 2,
  30. } ExitFlat;
  31. typedef enum ExitMode {
  32. em_activity = ef_activity, // 主动退出
  33. em_passive = ef_passive, // 被动退出
  34. } ExitMode;
  35. static const int PREFIX_COUNT = 2;
  36. typedef enum Prefix {
  37. prefix_quote = 0, // 变量引用
  38. prefix_exec_first = 1,
  39. } Prefix;
  40. static const std::string E_PREFIX = "$`'"; /* NOLINT element前缀 */
  41. static const std::string B_PREFIX = "$`'%^&<?>"; /* NOLINT block前缀 */
  42. class Message;
  43. class NormalMessage;
  44. class MessageStream;
  45. class UpMessage;
  46. class DownMessage;
  47. class Activation;
  48. class ExeActivation;
  49. class TopActivation;
  50. class FuncActivation;
  51. typedef enum ActivationStatus {
  52. as_run = 0,
  53. as_end = 1,
  54. } ActivationStatus;
  55. class GcList;
  56. class Object;
  57. class Function;
  58. class Var;
  59. class VarSpace;
  60. class VarList;
  61. class ProtectVarSpace;
  62. typedef enum VarOperationFlat {
  63. vof_success = 0, // 成功
  64. vof_not_var = 1, // 变量不存在
  65. vof_redefine_var = 2, // 变量重复定义
  66. vof_fail = 3, // 存在其他错误
  67. } VarOperationFlat;
  68. }
  69. #endif //AFUN_CORE_HPP