2
0

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. AFUN_CORE_EXPORT class Code;
  17. AFUN_CORE_EXPORT class EnvVarSpace;
  18. AFUN_CORE_EXPORT class 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. AFUN_CORE_EXPORT class Message;
  44. AFUN_CORE_EXPORT class NormalMessage;
  45. AFUN_CORE_EXPORT class ErrorMessage;
  46. AFUN_CORE_EXPORT class MessageStream;
  47. AFUN_CORE_EXPORT class UpMessage;
  48. AFUN_CORE_EXPORT class DownMessage;
  49. AFUN_CORE_EXPORT class Activation;
  50. AFUN_CORE_EXPORT class ExeActivation;
  51. AFUN_CORE_EXPORT class TopActivation;
  52. AFUN_CORE_EXPORT class FuncActivation;
  53. typedef enum ActivationStatus {
  54. as_run = 0,
  55. as_end = 1,
  56. as_end_run = 2,
  57. } ActivationStatus;
  58. AFUN_CORE_EXPORT class GcList;
  59. AFUN_CORE_EXPORT class Object;
  60. AFUN_CORE_EXPORT class Function;
  61. AFUN_CORE_EXPORT class Literaler;
  62. AFUN_CORE_EXPORT class CallBackVar;
  63. AFUN_CORE_EXPORT class Var;
  64. AFUN_CORE_EXPORT class VarSpace;
  65. AFUN_CORE_EXPORT class VarList;
  66. AFUN_CORE_EXPORT class 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