core.h 2.4 KB

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