inter.h 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  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 *none;
  14. FILE *debug;
  15. FILE *error;
  16. char *log_dir; // 记录log文件夹的位置
  17. char *var_str_prefix;
  18. char *var_num_prefix;
  19. char *var_defualt;
  20. char *object_init;
  21. char *object_new;
  22. char *object_enter;
  23. char *object_exit;
  24. } data;
  25. };
  26. typedef struct Inter Inter;
  27. typedef struct Statement Statement;
  28. Inter *makeInter(char *debug, struct LinkValue *father);
  29. void freeInter(Inter *inter, bool show_gc);
  30. void setBaseInterData(struct Inter *inter);
  31. int runCodeBlock(char *code_file, Inter *inter);
  32. void runParser(char *code_file, Inter *inter, Statement **st);
  33. void runCode(Statement *st, Inter *inter);
  34. void mergeInter(Inter *new, Inter *base);
  35. #endif //VIRTUALMATH_INTER_H