inter.h 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. #ifndef VIRTUALMATH_INTER_H
  2. #define VIRTUALMATH_INTER_H
  3. struct Result;
  4. struct Inter{
  5. struct Value *base;
  6. struct LinkValue *link_base;
  7. struct HashTable *hash_base;
  8. struct Var *base_var;
  9. struct LinkValue *base_father;
  10. struct VarList *var_list;
  11. struct InterData{
  12. struct Value *object;
  13. struct Value *vobject;
  14. struct Value *num;
  15. struct Value *str;
  16. struct Value *bool_;
  17. struct Value *pass_;
  18. struct Value *list;
  19. struct Value *dict;
  20. struct Value *function;
  21. struct Value *none;
  22. FILE *debug;
  23. FILE *error;
  24. char *log_dir; // 记录log文件夹的位置
  25. char *var_str_prefix;
  26. char *var_num_prefix;
  27. char *var_defualt;
  28. char *object_init;
  29. char *object_new;
  30. char *object_enter;
  31. char *object_exit;
  32. char *object_add;
  33. char *object_sub;
  34. char *object_mul;
  35. char *object_div;
  36. } data;
  37. };
  38. typedef struct Inter Inter;
  39. typedef struct Statement Statement;
  40. Inter *makeInter(char *debug, struct LinkValue *father);
  41. void freeInter(Inter *inter, bool show_gc);
  42. void setBaseInterData(struct Inter *inter);
  43. int runCodeBlock(char *code_file, Inter *inter);
  44. void runParser(char *code_file, Inter *inter, Statement **st);
  45. void runCode(Statement *st, Inter *inter);
  46. void mergeInter(Inter *new, Inter *base);
  47. #endif //VIRTUALMATH_INTER_H