inter.h 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  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. FILE *inter_stdin;
  15. bool is_stdout;
  16. bool is_stderr;
  17. bool is_stdin;
  18. struct Value *object;
  19. struct Value *vobject;
  20. struct Value *num;
  21. struct Value *str;
  22. struct Value *bool_;
  23. struct Value *pass_;
  24. struct Value *tuple;
  25. struct Value *list;
  26. struct Value *dict;
  27. struct Value *function;
  28. struct Value *none;
  29. struct Value *list_iter;
  30. struct Value *dict_iter;
  31. struct Value *base_exc;
  32. struct Value *sys_exc;
  33. struct Value *keyInterrupt_exc;
  34. struct Value *quit_exc;
  35. struct Value *exc;
  36. struct Value *type_exc;
  37. struct Value *arg_exc;
  38. struct Value *per_exc;
  39. struct Value *name_exc;
  40. struct Value *goto_exc;
  41. struct Value *result_exc;
  42. struct Value *assert_exc;
  43. struct Value *key_exc;
  44. struct Value *index_exc;
  45. struct Value *stride_exc;
  46. struct Value *super_exc;
  47. struct Value *iterstop_exc;
  48. struct Value *import_exc;
  49. struct Value *include_exp;
  50. char *var_str_prefix;
  51. char *var_num_prefix;
  52. char *var_bool_prefix;
  53. char *var_none;
  54. char *var_pass;
  55. char *var_class_prefix;
  56. char *var_object_prefix;
  57. char *object_init;
  58. char *object_new;
  59. char *object_call;
  60. char *object_enter;
  61. char *object_exit;
  62. char *object_add;
  63. char *object_sub;
  64. char *object_mul;
  65. char *object_div;
  66. char *object_del;
  67. char *object_down;
  68. char *object_slice;
  69. char *object_iter;
  70. char *object_next;
  71. char *object_repo;
  72. char *object_bool;
  73. char *object_name;
  74. char *object_self;
  75. char *object_father;
  76. char *object_message;
  77. char *object_str;
  78. char *object_down_assignment;
  79. char *object_slice_assignment;
  80. char *object_down_del;
  81. char *object_slice_del;
  82. int default_pt_type;
  83. } data;
  84. };
  85. typedef struct Inter Inter;
  86. typedef struct Statement Statement;
  87. typedef enum ResultType ResultType;
  88. Inter *makeInter(char *out, char *error_, char *in, LinkValue *belong);
  89. void freeInter(Inter *inter, bool show_gc);
  90. void setBaseInterData(struct Inter *inter);
  91. void runCodeStdin(Inter *inter, char *hello_string);
  92. void runCodeFile(Inter *inter, char *file[]);
  93. bool runParser(char *code_file, Inter *inter, bool is_one, Statement **st);
  94. void mergeInter(Inter *new, Inter *base);
  95. Inter *deriveInter(LinkValue *belong, Inter *inter);
  96. #endif //VIRTUALMATH_INTER_H