core.hpp 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  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. AFUN_CORE_EXPORT class Code;
  16. AFUN_CORE_EXPORT class EnvVarSpace;
  17. AFUN_CORE_EXPORT 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. AFUN_CORE_EXPORT class Message;
  43. AFUN_CORE_EXPORT class NormalMessage;
  44. AFUN_CORE_EXPORT class ErrorMessage;
  45. AFUN_CORE_EXPORT class MessageStream;
  46. AFUN_CORE_EXPORT class UpMessage;
  47. AFUN_CORE_EXPORT class DownMessage;
  48. AFUN_CORE_EXPORT class Activation;
  49. AFUN_CORE_EXPORT class ExeActivation;
  50. AFUN_CORE_EXPORT class TopActivation;
  51. AFUN_CORE_EXPORT class FuncActivation;
  52. typedef enum ActivationStatus {
  53. as_run = 0,
  54. as_end = 1,
  55. as_end_run = 2,
  56. } ActivationStatus;
  57. AFUN_CORE_EXPORT class GcList;
  58. AFUN_CORE_EXPORT class Object;
  59. AFUN_CORE_EXPORT class Function;
  60. AFUN_CORE_EXPORT class Literaler;
  61. AFUN_CORE_EXPORT class CallBackVar;
  62. AFUN_CORE_EXPORT class Var;
  63. AFUN_CORE_EXPORT class VarSpace;
  64. AFUN_CORE_EXPORT class VarList;
  65. AFUN_CORE_EXPORT class ProtectVarSpace;
  66. typedef enum VarOperationFlat {
  67. vof_success = 0, // 成功
  68. vof_not_var = 1, // 变量不存在
  69. vof_redefine_var = 2, // 变量重复定义
  70. vof_fail = 3, // 存在其他错误
  71. } VarOperationFlat;
  72. }
  73. #endif //AFUN_CORE_HPP