inter.h 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  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_bool_prefix;
  28. char *var_none;
  29. char *var_pass;
  30. char *var_class_prefix;
  31. char *var_object_prefix;
  32. char *object_init;
  33. char *object_new;
  34. char *object_call;
  35. char *object_enter;
  36. char *object_exit;
  37. char *object_add;
  38. char *object_sub;
  39. char *object_mul;
  40. char *object_div;
  41. char *object_del;
  42. char *object_down;
  43. char *object_slice;
  44. int default_pt_type;
  45. } data;
  46. };
  47. typedef struct Inter Inter;
  48. typedef struct Statement Statement;
  49. Inter *makeInter(char *debug, struct LinkValue *belong);
  50. void freeInter(Inter *inter, bool show_gc);
  51. void setBaseInterData(struct Inter *inter);
  52. int runCodeBlock(char *code_file, Inter *inter);
  53. void runParser(char *code_file, Inter *inter, Statement **st);
  54. void runCode(Statement *st, Inter *inter);
  55. void mergeInter(Inter *new, Inter *base);
  56. #endif //VIRTUALMATH_INTER_H