inter.h 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  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. FILE *inter_stdout;
  13. FILE *inter_stderr;
  14. bool is_stdout;
  15. bool is_stderr;
  16. struct Value *object;
  17. struct Value *vobject;
  18. struct Value *num;
  19. struct Value *str;
  20. struct Value *bool_;
  21. struct Value *pass_;
  22. struct Value *list;
  23. struct Value *dict;
  24. struct Value *function;
  25. struct Value *none;
  26. struct Value *list_iter;
  27. struct Value *dict_iter;
  28. struct Value *base_exc;
  29. struct Value *exc;
  30. struct Value *type_exc;
  31. struct Value *arg_exc;
  32. struct Value *per_exc;
  33. struct Value *name_exc;
  34. struct Value *goto_exc;
  35. struct Value *result_exc;
  36. struct Value *assert_exc;
  37. struct Value *key_exc;
  38. struct Value *index_exc;
  39. struct Value *stride_exc;
  40. struct Value *super_exc;
  41. struct Value *iterstop_exc;
  42. struct Value *import_exc;
  43. struct Value *include_exp;
  44. char *var_str_prefix;
  45. char *var_num_prefix;
  46. char *var_bool_prefix;
  47. char *var_none;
  48. char *var_pass;
  49. char *var_class_prefix;
  50. char *var_object_prefix;
  51. char *object_init;
  52. char *object_new;
  53. char *object_call;
  54. char *object_enter;
  55. char *object_exit;
  56. char *object_add;
  57. char *object_sub;
  58. char *object_mul;
  59. char *object_div;
  60. char *object_del;
  61. char *object_down;
  62. char *object_slice;
  63. char *object_iter;
  64. char *object_next;
  65. int default_pt_type;
  66. } data;
  67. };
  68. typedef struct Inter Inter;
  69. typedef struct Statement Statement;
  70. typedef enum ResultType ResultType;
  71. Inter *makeInter(char *out, char *error_, struct LinkValue *belong);
  72. void freeInter(Inter *inter, bool show_gc);
  73. void setBaseInterData(struct Inter *inter);
  74. ResultType runCodeBlock(char *code_file, Inter *inter);
  75. ResultType runCodeStdin(Inter *inter);
  76. void runParser(char *code_file, Inter *inter, bool is_one, Statement **st);
  77. ResultType runCode(Statement *st, Inter *inter);
  78. void mergeInter(Inter *new, Inter *base);
  79. #endif //VIRTUALMATH_INTER_H